• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/catalog/contractor/agentcontractrelationstoragestrategy.php
  • Класс: Bitrix\Crm\Integration\Catalog\Contractor\AgentContractRelationStorageStrategy
  • Вызов: AgentContractRelationStorageStrategy::getParentElements
public function getParentElements(ItemIdentifier $child, int $parentEntityTypeId): array
{
	$parents = [];

	if (
		$child->getEntityTypeId() === \CCrmOwnerType::AgentContractDocument
		&& $parentEntityTypeId === $this->entityTypeId
	)
	{
		$items = AgentContractContractorTable::query()
			->setSelect(['ENTITY_ID'])
			->where('CONTRACT_ID', $child->getEntityId())
			->where('ENTITY_TYPE_ID', $this->entityTypeId)
			->exec();

		while ($item = $items->fetch())
		{
			$parents[] = new ItemIdentifier(
				$this->entityTypeId,
				(int)$item['ENTITY_ID']
			);
		}
	}

	return $parents;
}