예제 #1
0
 public function addRelation(Relation $relation)
 {
     $targetId = null;
     //startnode is always of type node
     $sourceId = $this->addNode($relation->getStart());
     if ($relation->getProperty()->getDatatype() == 'node') {
         $targetId = $this->addNode($relation->getValue());
     } elseif ($relation->getProperty()->getDatatype() == 'geometry') {
         //not added
     } else {
         $targetId = $this->addValue($relation->getValue());
     }
     if (isset($targetId)) {
         $this->links[] = ['source' => $sourceId, 'target' => $targetId, 'pname' => $relation->getProperty()->getName()];
     }
 }
예제 #2
0
파일: DAO.php 프로젝트: samuvack/admin
 public function addRelation(Relation $relation)
 {
     if ($relation->getProperty()->getDataType() == 'node') {
         if (!$this->validateNodeRelation($relation)) {
             return;
         }
     } else {
         if ($relation->getProperty()->getDataType() == 'geometry') {
             if (!$this->validateGeometryRelation($relation)) {
                 return;
             }
         } else {
             if (!$this->validateRelation($relation)) {
                 return;
             }
         }
     }
     $this->em->persist($relation);
 }