• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/v2/Facade/Repository.php
  • Класс: BitrixCatalogv2FacadeRepository
  • Вызов: Repository::loadFromProductRepository
private function loadFromProductRepository(int $iblockId, int $productId): ?BaseProduct
{
	static $repository = null;

	if ($repository === null)
	{
		$repository = ServiceContainer::getProductRepository($iblockId);
		if (!$repository)
		{
			return null;
		}
	}

	$repository->setAutoloadDetailUrl($this->checkAutoloadDetailUrl());
	$urlTemplate = $this->getDetailUrlTemplate();
	if ($urlTemplate)
	{
		$repository->setDetailUrlTemplate($urlTemplate);
	}

	return $repository->getEntityById($productId);
}