Skip to content

Commit

Permalink
Make ObjectTrait::serialize() overrides easier
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Aug 13, 2018
1 parent 5c2f994 commit 42ff8ea
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion system/src/Grav/Framework/Object/Base/ObjectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public function defProperty($property, $default)
*/
public function serialize()
{
return serialize($this->jsonSerialize());
return serialize($this->doSerialize());
}

/**
Expand All @@ -134,6 +134,14 @@ public function unserialize($serialized)
$this->doUnserialize($data);
}

/**
* @return array
*/
protected function doSerialize()
{
return $this->jsonSerialize();
}

/**
* @param array $serialized
*/
Expand Down

0 comments on commit 42ff8ea

Please sign in to comment.