protected function createEdge($from, $to)
 {
     if (!$from || !$to) {
         return null;
     }
     $exists = $this->edgeExists($from, $to);
     if ($exists) {
         return $exists;
     }
     $edge = new Edge();
     $edge->setFrom($from)->setTo($to);
     $this->getEntityManager()->persist($edge);
     $this->getEntityManager()->flush($edge);
     return $edge;
 }
Beispiel #2
0
 protected function createEdge($from, $to)
 {
     $em = $this->getEntityManager();
     $edge = new Edge();
     $edge->setFrom($from)->setTo($to);
     $em->persist($edge);
     $em->flush($edge);
     return $edge;
 }