StoreDocumentRelationStorageStrategy::getParentElements

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

	if (
		$child->getEntityTypeId() === \CCrmOwnerType::StoreDocument
		&& $parentEntityTypeId === $this->entityTypeId
	)
	{
		$items = StoreDocumentContractorTable::query()
			->setSelect(['ENTITY_ID'])
			->where('DOCUMENT_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;
}

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