ContactToFactory::areItemsBound

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. ContactToFactory
  4. areItemsBound
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Relation/StorageStrategy/ContactToFactory.php
  • Класс: Bitrix\Crm\Relation\StorageStrategy\ContactToFactory
  • Вызов: ContactToFactory::areItemsBound
public function areItemsBound(ItemIdentifier $parent, ItemIdentifier $child): bool
{
	$item = $this->childFactory->getItem($child->getEntityId());

	if ($item)
	{
		/** @var Contact $contact */
		foreach ($item->get(Item::FIELD_NAME_CONTACTS) as $contact)
		{
			if ($contact->getId() === $parent->getEntityId())
			{
				return true;
			}
		}
	}

	return false;
}

Добавить комментарий