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()]; } }
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(); }
public function filter(Relation $relation) { $date2 = $relation->getValue(); return $date2->getDay() === $this->getDay() && $date2->getMonth() === $this->getMonth() && $date2->getYear() === $this->getYear(); }
private function validateGeometryRelation(Relation $relation) { if (!isset($this->geoRelations[$relation->getStart()->getId()])) { $this->geoRelations[$relation->getStart()->getId()] = array(); } else { if (isset($this->geoRelations[$relation->getStart()->getId()][$relation->getValue()])) { return false; } } $this->relations[$relation->getStart()->getId()][$relation->getValue()] = true; $dbrel = $this->relRepo->findOneBy(array('startNode' => $relation->getStart(), 'geometryvalue' => $relation->getValue())); if ($dbrel !== null) { return false; } return true; }
public function filter(Relation $relation) { return $relation->getValue()->__toString() == $this->__toString(); }
public function filter(Relation $relation) { $value = $relation->getValue(); return $this->start <= $value->getEndyear() && $value->getStartyear() <= $this->end; }