It's a minor change, but it's completely necessary. as an example consider a RestfulAPI written in PHP, think you did a byExample search for some documents, so as a result you have an array of arango objects now.
Then you need to return these results in json format and we use json_encode() function for that job. but it will return an empty result. the reason is that arango document class does not implement JsonSerializable. a minor change will make everything easy and fun:
adding this function at the end of Document.php
public function jsonSerialize(array $options = []) { return $this->getAll($options); }
change first line of class defenition
class Document implements \JsonSerializable
It's a minor change, but it's completely necessary. as an example consider a RestfulAPI written in PHP, think you did a byExample search for some documents, so as a result you have an array of arango objects now. Then you need to return these results in json format and we use json_encode() function for that job. but it will return an empty result. the reason is that arango document class does not implement JsonSerializable. a minor change will make everything easy and fun:
adding this function at the end of Document.php
public function jsonSerialize(array $options = []) { return $this->getAll($options); }
change first line of class defenition
class Document implements \JsonSerializable