- Модуль: disk
- Путь к файлу: ~/bitrix/modules/disk/lib/storage.php
- Класс: BitrixDiskStorage
- Вызов: Storage::addFileLink
public function addFileLink(File $sourceFile, array $data, array $rights = array(), $generateUniqueName = false)
{
$this->errorCollection->clear();
$rootFolder = $this->getRootObject();
if(!$rootFolder)
{
$this->errorCollection->add(array(new Error("Storage doesn't have root folder.", self::ERROR_NOT_EXISTS_ROOT_OBJECT)));
return null;
}
$fileLinkModel = $rootFolder->addFileLink($sourceFile, $data, $rights, $generateUniqueName);
if(!$fileLinkModel)
{
$this->errorCollection->add($rootFolder->getErrors());
return null;
}
return $fileLinkModel;
}