File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,25 @@ drop() just needs the name of the collection name to be dropped:
609
609
$collectionHandler->drop('example');
610
610
```
611
611
612
+ # Custom Document class
613
+
614
+ If you want to use custom document class you can pass it's name to DocumentHandler or CollectionHandler using method ` setDocumentClass ` .
615
+ Remember that Your class must extend ` \ArangoDBClient\Document ` .
616
+
617
+ ``` php
618
+ $ch = new CollectionHandler($connection);
619
+ $ch->setDocumentClass('\AppBundle\Entity\Product');
620
+ $cursor = $ch->all('product');
621
+ // All returned documents will be \AppBundle\Entity\Product instances
622
+
623
+
624
+ $dh = new DocumentHandler($connection);
625
+ $dh->setDocumentClass('\AppBundle\Entity\Product');
626
+ $product = $dh->get('products', 11231234);
627
+ // Product will be \AppBundle\Entity\Product instance
628
+ ```
629
+
630
+ See file examples/customDocumentClass.php for more details.
612
631
613
632
<a name =" logging_exceptions " ></a >
614
633
## Logging exceptions
You can’t perform that action at this time.
0 commit comments