• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Relation/StorageStrategy/ContactCompanyToOrder.php
  • Класс: Bitrix\Crm\Relation\StorageStrategy\ContactCompanyToOrder
  • Вызов: ContactCompanyToOrder::getParentElements
public function getParentElements(ItemIdentifier $child, int $parentEntityTypeId): array
{
	/** @var Order|null $order */
	$order = Order::load($child->getEntityId());
	if (!$order)
	{
		return [];
	}

	$parents = [];
	/** @var ContactCompanyEntity $client */
	foreach ($order->getContactCompanyCollection() as $client)
	{
		if ($client::getEntityType() === $parentEntityTypeId)
		{
			$parents[] = new ItemIdentifier($client::getEntityType(), $client->getField('ENTITY_ID'));
		}
	}

	return $parents;
}