• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/v2/productrow.php
  • Класс: Bitrix\Crm\Controller\v2\ProductRow
  • Вызов: ProductRow::getFactoryAndItem
protected function getFactoryAndItem(string $ownerType, int $ownerId): ?array
{
	$entityTypeId = \CCrmOwnerType::ResolveID($ownerType);
	$factory = Container::getInstance()->getFactory($entityTypeId);
	if (!$factory || !$this->isEntityTypeSupported($entityTypeId))
	{
		$this->addError(
			ErrorCode::getEntityTypeNotSupportedError($entityTypeId)
		);

		return null;
	}

	$item = $factory->getItem($ownerId);
	if (!$item)
	{
		$this->addError(
			ErrorCode::getOwnerNotFoundError()
		);

		return null;
	}

	return [$factory, $item];
}