EntityRelationTable::getChildElements

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityRelationTable
  4. getChildElements
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Relation/StorageStrategy/EntityRelationTable.php
  • Класс: Bitrix\Crm\Relation\StorageStrategy\EntityRelationTable
  • Вызов: EntityRelationTable::getChildElements
public function getChildElements(ItemIdentifier $parent, int $childEntityTypeId): array
{
	$collection =
		static::$tableClass::getList([
			'filter' => [
				'=SRC_ENTITY_TYPE_ID' => $parent->getEntityTypeId(),
				'=SRC_ENTITY_ID' => $parent->getEntityId(),
				'=DST_ENTITY_TYPE_ID' => $childEntityTypeId,
			],
		])
			->fetchCollection()
	;

	$children = [];
	foreach ($collection as $entityObject)
	{
		$children[] = new ItemIdentifier($entityObject->getDstEntityTypeId(), $entityObject->getDstEntityId());
	}

	return $children;
}

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