Выполним действие

@param integer $fileid ИД файла

@return array

@version 08.01.2019
@author  Дмитрий Щербаков <atomcms@ya.ru>
162891
public function run($fileid)
    {
        $info = $this->file_info->getOneORM($fileid);
        if (is_array($info)) {
            return $info;
        }

        if ($this->file_rights->check($info->container_type, $info->container_id) === false) {
            return Response::error403('Доступ ограничен', false, [
                'file_id' => $fileid,
            ]);
        }

        $file_path = SettingsFile::FILE_FOLDER . $info->path;

        if (SettingsFile::FULL_REMOVE) {
            $info->delete();
        } else {
            $info->deleted_at = $this->dic['datetimenow'];
            $info->save();
        }

        if (is_object($info)) {
            /** @var DataChangeLog $datachangelog */
            $datachangelog = $this->dic['datachangelog'];
            $datachangelog->insert('files', 'delete', $info->id, $info->as_array());

            if (SettingsFile::FULL_REMOVE) {
                @unlink($file_path);
            }

            return Response::data([
                'id' => $fileid,
            ]);
        } else {
            return Response::error500('Файл не был удалён, попробуйте ещё раз', [
                'file_id' => $fileid,
            ]);
        }
    }
104155
public function get_file_by_id($fileid) {
        global $DB;

        $sql = "SELECT ".self::instance_sql_fields('f', 'r')."
                  FROM {files} f
             LEFT JOIN {files_reference} r
                       ON f.referencefileid = r.id
                 WHERE f.id = ?";
        if ($filerecord = $DB->get_record_sql($sql, array($fileid))) {
            return $this->get_file_instance($filerecord);
        } else {
            return false;
        }
    }
660701
public function updateFile($fileId, array $data)
    {
        $xml = "<file>";

        if (isset($data['name'])) {
            $xml .= "<name>{$data['name']}</name>";
        }

        if (isset($data['categoryId'])) {
            $xml .= "<categoryId>{$data['categoryId']}</categoryId>";
        }

        if (isset($data['shareWithEmployee'])) {
            $xml .= "<shareWithEmployee>{$data['shareWithEmployee']}</shareWithEmployee>";
        }

        $xml .= "</file>";

        return $this->post("files/{$fileId}", $xml);
    }
123694
public function listRevisions($fileId, $optParams = array())
  {
    $params = array('fileId' => $fileId);
    $params = array_merge($params, $optParams);
    return $this->call('list', array($params), "Drive_RevisionList");
  }
542217
public function findOrganizationFile($organizationId, $fileId)
    {
        list($response) = $this->findOrganizationFileWithHttpInfo($organizationId, $fileId);
        return $response;
    }
110600
protected function getVariant($fileID)
    {
        $parsedFiledID = $this->getPublicResolutionStrategy()->parseFileID($fileID);
        return $parsedFiledID ? $parsedFiledID->getVariant() : null;
    }
1206483
public function getFoldersArrayItem($folderId)
    {
        return (isset($this->foldersArray[$folderId])) ? $this->foldersArray[$folderId] : false;
    }
1233745
public function bulkUploadAction($folderId)
    {
        $em = $this->getDoctrine()->getManager();

        /* @var Folder $folder */
        $folder = $em->getRepository('KunstmaanMediaBundle:Folder')->getFolder($folderId);

        return ['folder' => $folder];
    }
761693
public function getFromId( $FileUploadId){
        $rest = $this->getService( self::API_UPLOAD . $FileUploadId);
        $rest->GET();

        return $rest->getResult( models\FileSystem\FileUpload::class);
    }
203669
public function findByFileId($fileId)
    {
        foreach ($this->volumes as $volume) {
            try {
                $file = $volume->findFile($fileId);
                if ($file) {
                    return $volume;
                }
            } catch (\Exception $e) {
            }
        }

        return null;
    }
321130
public function read( $id )
	{
	    if ( $this->has( $id ) )
		{
			return unserialize( \CCFile::read( $this->file_path( $id ) ) );
		}
		
		return array();
	}
1207882
public function files($directory)
    {
        $this->checkDirectory($directory);

        $disk = $this->disk();

        // TODO: Add a feature to exclude unwanted files.
        $files = array_map(function ($filePath) use ($disk, $directory) {
            return [
                'name'         => str_replace("$directory/", '', $filePath),
                'path'         => $filePath,
                'url'          => $disk->url($filePath),
                'mimetype'     => $disk->mimeType($filePath),
                'lastModified' => Carbon::createFromTimestamp($disk->lastModified($filePath))->toDateTimeString(),
                'visibility'   => $disk->getVisibility($filePath),
                'size'         => $disk->size($filePath),
            ];
        }, $disk->files($directory));

        return FileCollection::make($files)->exclude($this->getExcludedFiles());
    }
1265677
protected function createDataObject($fileID)
    {
        $recordClass = $this->component->getRecordClassName($this->gridField);
        $record = $recordClass::create();
        $record->write();

        $record->extend('onBulkUpload', $this->gridField);

        $fileRelationName = $this->component->getFileRelationName($this->gridField);
        $record->{"{$fileRelationName}ID"} = $fileID;
        $record->write(); //HasManyList call write on record but not ManyManyList, so we call it here again
        
        $this->gridField->list->add($record);

        if ($this->component->getAutoPublishDataObject() && $record->hasExtension('Versioned'))
        {
            $record->publishRecursive();
        }

        return $record;
    }
567130
public function getRaw($fileId = null)
    {
        // does nothing with the text
        $lamdaFunction = function($text){ 
            return [$text];
        };        
        return $this->getWords($fileId, new LambdaTokenizer($lamdaFunction));        
    }
1081464
public function callbackAddImageToIndex($fileId)
    {
        $image = Yii::$app->storage->addImage($fileId);
        
        if (!$image) {
            return $this->sendError("Unable to create image from given file Id.");
        }

        Yii::$app->db->createCommand()->insert($this->refTableName, $this->prepareInsertFields([
            $this->imageIdFieldName => (int) $image->id,
            $this->refFieldName => (int) $this->itemId,
        ]))->execute();

        return $this->getImageArray($image->id);
    }
1120579
public function run($fileid, $filename = '')
    {
        $info = (new FileInfo())->getOneORM($fileid);
        if (is_array($info)) {
            return $info;
        }

        if ((new FileRights($this->dic))->check($info->container_type, $info->container_id) === false) {
            return Response::error403('Доступ ограничен', false);
        }

        $file_path = SettingsFile::FILE_FOLDER . $info->path;

        if (is_readable($file_path) && is_file($file_path)) {
            if (empty($filename)) {
                $name = $info->name . '.' . $info->ext;
            } else {
                $pathinfo = pathinfo($filename);

                if ($pathinfo['extension'] === $info->ext) {
                    $name = $filename;
                } else {
                    $name = $filename . '.' . $info->ext;
                }
            }

            $token = (new FileToken($this->dic))->generate($info->path, $name);
            if (empty($token)) {
                return Response::error500('Ключ для скачивания файла не был создан, попробуйте ещё раз');
            }

            return Response::data([
                'token' => $token,
            ]);
        } else {
            return Response::error404('Файл не найден');
        }
    }
1133362
protected function getFilesystemFor($fileID)
    {
        return $this->applyToFileIDOnFilesystem(
            function (ParsedFileID $parsedFileID, Filesystem $fs) {
                return $fs;
            },
            $fileID
        );
    }