Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions src/Illuminate/Queue/SerializesModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,6 @@ trait SerializesModels
{
use SerializesAndRestoresModelIdentifiers;

/**
* Prepare the instance for serialization.
*
* @return array
*/
public function __sleep()
{
$properties = (new ReflectionClass($this))->getProperties();

foreach ($properties as $property) {
$property->setValue($this, $this->getSerializedPropertyValue(
$this->getPropertyValue($property)
));
}

return array_values(array_filter(array_map(function ($p) {
return $p->isStatic() ? null : $p->getName();
}, $properties)));
}

/**
* Restore the model after serialization.
*
* @return void
*/
public function __wakeup()
{
foreach ((new ReflectionClass($this))->getProperties() as $property) {
if ($property->isStatic()) {
continue;
}

$property->setValue($this, $this->getRestoredPropertyValue(
$this->getPropertyValue($property)
));
}
}

/**
* Prepare the instance values for serialization.
*
Expand Down