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