• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/file.php
  • Класс: BitrixLandingFile
  • Вызов: File::add
static function add(int $fileId, int $entityId, string $entityType, bool $temp = false): void
{
	$res = FileTable::getList(array(
		'select' => array(
			'ID'
		),
		'filter' => array(
			'FILE_ID' => $fileId,
			'ENTITY_ID' => $entityId,
			'=ENTITY_TYPE' => $entityType
		)
	));
	if (!$res->fetch())
	{
		$res = FileTable::add(array(
			'FILE_ID' => $fileId,
			'ENTITY_ID' => $entityId,
			'ENTITY_TYPE' => $entityType,
			'TEMP' => $temp ? 'Y' : 'N'
		));
		$res->isSuccess();
	}
}