Skip to content

Commit dadd6f3

Browse files
author
diabl0
committed
Removed \JsonSerializable from Document due to PR #206
1 parent 84e720b commit dadd6f3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

examples/customDocumentClass.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require __DIR__ . '/init.php';
66

77

8-
abstract class AbstractEntity extends Document
8+
abstract class AbstractEntity extends Document implements \JsonSerializable
99
{
1010
/**
1111
* Collection name.
@@ -68,6 +68,18 @@ public function onUpdate()
6868
{
6969

7070
}
71+
72+
/**
73+
* Specify data which should be serialized to JSON
74+
* @link http://php.net/manual/en/jsonserializable.jsonserialize.php
75+
* @return mixed data which can be serialized by <b>json_encode</b>,
76+
* which is a value of any type other than a resource.
77+
* @since 5.4.0
78+
*/
79+
function jsonSerialize()
80+
{
81+
return $this->getAll();
82+
}
7183
}
7284

7385
abstract class AbstractCollection extends CollectionHandler

lib/ArangoDBClient/Document.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @package ArangoDBClient
2020
* @since 0.2
2121
*/
22-
class Document implements \JsonSerializable
22+
class Document implements
2323
{
2424
/**
2525
* The document id (might be NULL for new documents)

0 commit comments

Comments
 (0)