ContactToFactory::getParentElements

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

	$parents = [];
	/** @var Contact $contact */
	foreach ($item->get(Item::FIELD_NAME_CONTACTS) as $contact)
	{
		$parents[] = new ItemIdentifier(\CCrmOwnerType::Contact, $contact->getId());
	}

	return $parents;
}

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