Factory::getParentElements

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

	$parentEntityId = $item->get($this->parentIdFieldName);
	if (!empty($parentEntityId))
	{
		return [new ItemIdentifier($parentEntityTypeId, $parentEntityId)];
	}

	return [];
}

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