Beispiel #1
0
 public function getNeighbor(Document $document, $edgeCollection, $filter, $limit = false)
 {
     if ($limit) {
         $resultLimit = $limit;
     } else {
         $resultLimit = self::RESULT_LIMIT;
     }
     $query = 'FOR d in ' . $document->getCollectionName() . ' FILTER d._id=="' . $document->getId() . '" FOR n IN NEIGHBORS(' . $document->getCollectionName() . ', ' . $edgeCollection . ', d, "any", [], {includeData: true}) ';
     if (!empty($filter)) {
         $query .= 'FILTER ' . $this->filterToAqlFilter($filter, 'n', true) . ' ';
     }
     $query .= 'LIMIT ' . $resultLimit . ' RETURN n';
     return $this->query($query);
 }
 public function __construct(array $config = [])
 {
     $this->config = new Config($config);
     Document::setDocumentManager($this);
     //all Documents will use this DocumentManager now
 }