protected function updateRelationship($oldEntity, $newEntity, $allowNull)
{
$key = $this->metadata->relationship->property;
if (!$key) {
return;
}
$this->updatingReverseRelationship = true;
if ($oldEntity) {
$oldEntity->getValue($key)->remove($this->parent);
}
if ($newEntity) {
$newEntity->getValue($key)->add($this->parent);
}
$this->updatingReverseRelationship = false;
}