File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 19
19
* @package ArangoDBClient
20
20
* @since 0.2
21
21
*/
22
- class Document
22
+ class Document implements \JsonSerializable
23
23
{
24
24
/**
25
25
* The document id (might be NULL for new documents)
@@ -773,6 +773,22 @@ public function getRevision()
773
773
return $ this ->_rev ;
774
774
}
775
775
776
+ /**
777
+ * Get all document attributes
778
+ * Alias function for getAll() - it's necessary for implementing JsonSerializable interface
779
+ *
780
+ * @param mixed $options - optional, array of options for the getAll function, or the boolean value for $includeInternals
781
+ * <p>Options are :
782
+ * <li>'_includeInternals' - true to include the internal attributes. Defaults to false</li>
783
+ * <li>'_ignoreHiddenAttributes' - true to show hidden attributes. Defaults to false</li>
784
+ * </p>
785
+ *
786
+ * @return array - array of all document attributes/values
787
+ */
788
+ public function jsonSerialize (array $ options = [])
789
+ {
790
+ return $ this ->getAll ($ options );
791
+ }
776
792
}
777
793
778
794
class_alias (Document::class, '\triagens\ArangoDb\Document ' );
You can’t perform that action at this time.
0 commit comments