• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/component/base.php
  • Класс: BitrixIblockComponentBase
  • Вызов: Base::getAdditionalCacheId
protected function getAdditionalCacheId();

/**
 * Return component cache path.
 *
 * @return mixed
 */
abstract protected function getComponentCachePath();

public function getTemplateEmptyPreview()
{
	$emptyPreview = false;
	$documentRoot = MainApplication::getDocumentRoot();
	$emptyPreviewPath = $this->getTemplate()->GetFolder().'/images/no_photo.png';

	$file = new MainIOFile($documentRoot.$emptyPreviewPath);
	if ($file->isExists())
	{
		$size = getimagesize($documentRoot.$emptyPreviewPath);
		if (!empty($size))
		{
			$emptyPreview = array(
				'ID' => 0,
				'SRC' => $emptyPreviewPath,
				'FILE_NAME' => 'no_photo.png',
				'WIDTH' => (int)$size[0],
				'HEIGHT' => (int)$size[1]
			);
		}
	}

	return $emptyPreview;
}