PHP Class skeeks\cms\components\storage\Storage

Inheritance: extends skeeks\cms\components\CollectionComponents
Show file Open project: skeeks-cms/cms

Public Properties

Property Type Description
$components

Protected Properties

Property Type Description
$_clusters

Public Methods

Method Description
getCluster ( null $id = null ) : Cluster
getClusters ( ) : Cluster[]
upload ( UploadedFile | string | skeeks\sx\File $file, array $data = [], null $clusterId = null ) : StorageFile Загрузить файл в хранилище, добавить в базу, вернуть модель StorageFile

Method Details

getCluster() public method

public getCluster ( null $id = null ) : Cluster
$id null
return Cluster

getClusters() public method

public getClusters ( ) : Cluster[]
return Cluster[]

upload() public method

Загрузить файл в хранилище, добавить в базу, вернуть модель StorageFile
public upload ( UploadedFile | string | skeeks\sx\File $file, array $data = [], null $clusterId = null ) : StorageFile
$file yii\web\UploadedFile | string | skeeks\sx\File объект UploadedFile или File или rootPath до файла локально или http:// путь к файлу (TODO:: доделать)
$data array данные для сохранения в базу
$clusterId null идентификатор кластера по умолчанию будет выбран первый из конфигурации
return skeeks\cms\models\StorageFile

Property Details

$_clusters protected property

protected $_clusters

$components public property

public $components