...Человеческий поиск в разработке...
- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/Relation/StorageStrategy/ContactToOrder.php
- Класс: Bitrix\Crm\Relation\StorageStrategy\ContactToOrder
- Вызов: ContactToOrder::afterBindingDeletion
protected function afterBindingDeletion(Order $order): void { $collection = $order->getContactCompanyCollection(); if (!$collection->isPrimaryItemExists(\CCrmOwnerType::Contact)) { /** @var Contact[] $contacts */ $contacts = iterator_to_array($collection->getContacts()); $firstNotDeletedContact = array_shift($contacts); if ($firstNotDeletedContact) { $firstNotDeletedContact->setField('IS_PRIMARY', 'Y'); } } }