• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Relation/StorageStrategy/EntityRelationTable.php
  • Класс: Bitrix\Crm\Relation\StorageStrategy\EntityRelationTable
  • Вызов: EntityRelationTable::getParentElements
public function getParentElements(ItemIdentifier $child, int $parentEntityTypeId): array
{
	$collection =
		static::$tableClass::getList([
			'filter' => [
				'=DST_ENTITY_TYPE_ID' => $child->getEntityTypeId(),
				'=DST_ENTITY_ID' => $child->getEntityId(),
				'=SRC_ENTITY_TYPE_ID' => $parentEntityTypeId,
			],
		])
			->fetchCollection()
	;

	$parents = [];
	foreach ($collection as $entityObject)
	{
		$parents[] = new ItemIdentifier($entityObject->getSrcEntityTypeId(), $entityObject->getSrcEntityId());
	}

	return $parents;
}