Exemplo n.º 1
0
 public function getDeleteQuery($object)
 {
     $query = 'MATCH (n) WHERE id(n) = {id} DELETE n';
     $id = $this->classMetadata->getIdValue($object);
     return Statement::create($query, ['id' => $id]);
 }
 public function addToCollectionAdvanced($object, $value, NodeEntityMetadata $valueMetadata)
 {
     if (!$this->isCollection()) {
         throw new \LogicException(sprintf('The property mapping of this relationship is not of collection type in "%s"', $this->className));
     }
     /** @var Collection $coll */
     $coll = $this->getValue($object);
     foreach ($coll->toArray() as $el) {
         $eid = $valueMetadata->getIdValue($valueMetadata);
         $vid = $valueMetadata->getIdValue($valueMetadata);
         if ($eid !== $vid) {
             $coll->add($value);
         }
     }
 }