Example #1
0
 public function __construct(Relation $relation, User $user, $action)
 {
     $this->user = $user;
     $this->relation = $relation;
     $this->startnode = $relation->getStart();
     $this->setValue($relation->getValue());
     $this->rank = $relation->getRank();
     $this->action = $action;
     $this->qualifier = $relation->getQualifier();
     $this->action_time = new \DateTime();
 }
Example #2
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()];
     }
 }
Example #3
0
 public function filter(Relation $relation)
 {
     $date2 = $relation->getValue();
     return $date2->getDay() === $this->getDay() && $date2->getMonth() === $this->getMonth() && $date2->getYear() === $this->getYear();
 }
Example #4
0
 private function validateRelation(Relation $relation)
 {
     if (!isset($this->relations[$relation->getStart()->getId()])) {
         $this->relations[$relation->getStart()->getId()] = array();
     } else {
         if (isset($this->relations[$relation->getStart()->getId()][$relation->_getValue()])) {
             return false;
         }
     }
     $this->relations[$relation->getStart()->getId()][$relation->_getValue()] = true;
     $dbrel = $this->relRepo->findOneBy(array('startNode' => $relation->getStart(), 'value' => $relation->_getValue()));
     if ($dbrel !== null) {
         return false;
     }
     return true;
 }
Example #5
0
 public function filter(Relation $relation)
 {
     return $relation->getValue()->__toString() == $this->__toString();
 }
Example #6
0
 public function filter(Relation $relation)
 {
     $value = $relation->getValue();
     return $this->start <= $value->getEndyear() && $value->getStartyear() <= $this->end;
 }