File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 5
5
require __DIR__ . '/init.php ' ;
6
6
7
7
8
- abstract class AbstractEntity extends Document
8
+ abstract class AbstractEntity extends Document implements \JsonSerializable
9
9
{
10
10
/**
11
11
* Collection name.
@@ -68,6 +68,18 @@ public function onUpdate()
68
68
{
69
69
70
70
}
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
+ }
71
83
}
72
84
73
85
abstract class AbstractCollection extends CollectionHandler
Original file line number Diff line number Diff line change 19
19
* @package ArangoDBClient
20
20
* @since 0.2
21
21
*/
22
- class Document implements \JsonSerializable
22
+ class Document implements
23
23
{
24
24
/**
25
25
* The document id (might be NULL for new documents)
You can’t perform that action at this time.
0 commit comments