Registrar::getTrackedObjects

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Registrar
  4. getTrackedObjects
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/Relation/Registrar.php
  • Класс: Bitrix\Crm\Relation\Registrar
  • Вызов: Registrar::getTrackedObjects
private function getTrackedObjects(ItemIdentifier $parent, ItemIdentifier $child): array
{
	$result = new Result();

	$parentFactory = $this->container->getFactory($parent->getEntityTypeId());
	if (!$parentFactory)
	{
		return [
			null,
			null,
			$result->addError(new Error('Parent factory not found')),
		];
	}

	$childFactory = $this->container->getFactory($child->getEntityTypeId());
	if (!$childFactory)
	{
		return [
			null,
			null,
			$result->addError(new Error('Child factory not found')),
		];
	}

	$parentItem = $this->getItem($parentFactory, $parent);
	if (!$parentItem)
	{
		return [
			null,
			null,
			$result->addError(new Error('Parent item not found')),
		];
	}

	$childItem = $this->getItem($childFactory, $child);
	if (!$childItem)
	{
		return [
			null,
			null,
			$result->addError(new Error('Child item not found')),
		];
	}

	return [
		$parentFactory->getTrackedObject($parentItem),
		$childFactory->getTrackedObject($childItem),
		$result,
	];
}

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