• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/v2/Image/ImageRepository.php
  • Класс: BitrixCatalogv2ImageImageRepository
  • Вызов: ImageRepository::getEntityById
public function getEntityById(int $id, string $type = null): ?BaseEntity
{
	if ($id <= 0)
	{
		throw new OutOfRangeException($id);
	}

	$entities = $this->getEntitiesBy([
		'filter' => [
			'=ID' => $id,
		],
		'limit' => 1,
	], $type);

	return reset($entities) ?: null;
}