protected function updateRelationshipAdd(IEntity $entity)
{
if (!$this->metadata->relationship->property) {
return;
}
$otherSide = $entity->getProperty($this->metadata->relationship->property);
$otherSide->collection = null;
$otherSide->toAdd[spl_object_hash($this->parent)] = $this->parent;
$otherSide->modify();
}