fix case hook

This commit is contained in:
Yuri Kuznetsov
2023-02-28 09:01:05 +02:00
parent 1e29280a1d
commit 3392c843e6
@@ -63,6 +63,7 @@ class Contacts implements AfterSave
/** @var ?string $contactId */
$contactId = $entity->get('contactId');
$contactIdList = $entity->get('contactsIds') ?? [];
/** @var ?string $fetchedContactId */
$fetchedContactId = $entity->getFetched('contactId');
$relation = $this->entityManager
@@ -85,7 +86,7 @@ class Contacts implements AfterSave
}
if (!$contactId && $fetchedContactId) {
$relation->unrelate($fetchedContactId);
$relation->unrelateById($fetchedContactId);
return;
}