/** * @inheritdoc * @param Client $client * @return Relationship */ public function setClient(Client $client) { parent::setClient($client); // set the client of our start and end nodes if they exists and doesn't have client yet if ($this->start && !$this->start->getClient()) { $this->start->setClient($client); } if ($this->end && !$this->end->getClient()) { $this->end->setClient($client); } return $this; }
/** * @inheritdoc * @param Client $client * @return Node */ public function setClient(Client $client) { parent::setClient($client); // set the client of each label in case it's not set yet if ($this->labels) { foreach ($this->labels as $label) { if (!$label->getClient()) { $label->setClient($client); } } } return $this; }