diff --git a/lib/ArangoDBClient/Document.php b/lib/ArangoDBClient/Document.php index b1dddc52..9194455f 100644 --- a/lib/ArangoDBClient/Document.php +++ b/lib/ArangoDBClient/Document.php @@ -19,7 +19,7 @@ * @package ArangoDBClient * @since 0.2 */ -class Document +class Document implements \JsonSerializable { /** * The document id (might be NULL for new documents) @@ -233,6 +233,11 @@ public function toJson(array $options = []) return json_encode($this->getAll($options)); } + public function jsonSerialize() + { + return $this->getAll([]); + } + /** * Returns the document as a serialized string *