Skip to content
Closed
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
7 changes: 6 additions & 1 deletion lib/ArangoDBClient/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @package ArangoDBClient
* @since 0.2
*/
class Document
class Document implements \JsonSerializable
{
/**
* The document id (might be NULL for new documents)
Expand Down Expand Up @@ -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
*
Expand Down