Fixed Object serialization breaking if overriding jsonSerialize() method

This commit is contained in:
Matias Griese
2018-12-03 07:34:59 +02:00
parent e02fa1a4e7
commit d602cb6e9e
2 changed files with 3 additions and 2 deletions

View File

@@ -18,6 +18,7 @@
* Fixed clearing cache having no effect on Doctrine cache
* Fixed `Medium::relativePath()` for streams
* Fixed `FlexObject::update()` call with partial object update
* Fixed `Object` serialization breaking if overriding `jsonSerialize()` method
# v1.6.0-beta.6
## 11/12/2018

View File

@@ -140,7 +140,7 @@ trait ObjectTrait
*/
protected function doSerialize()
{
return $this->jsonSerialize();
return ['key' => $this->getKey(), 'type' => $this->getType(), 'elements' => $this->getElements()];
}
/**
@@ -163,7 +163,7 @@ trait ObjectTrait
*/
public function jsonSerialize()
{
return ['key' => $this->getKey(), 'type' => $this->getType(), 'elements' => $this->getElements()];
return $this->doSerialize();
}
/**