PHP Класс Webiny\Component\Storage\File\File

Наследование: implements Webiny\Component\Storage\File\FileInterface, use trait Webiny\Component\StdLib\StdObjectTrait, use trait Webiny\Component\EventManager\EventManagerTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$contents
$isDirectory
$key
$size
$storage Webiny\Component\Storage\Storage
$timeModified
$url

Открытые методы

Метод Описание
__construct ( string $key, Storage $storage ) : File Construct a File instance
delete ( )
exists ( ) : boolean Check if file exists
getAbsolutePath ( ) : string Get absolute file path.
getContents ( )
getKey ( )
getSize ( ) : integer | null Get file size in bytes
getStorage ( )
getTimeModified ( $asDateTimeObject = false )
getUrl ( )
isDirectory ( ) : boolean Checks if file is a directory.
rename ( $newKey )
setContents ( $contents, $append = false )
touch ( ) Touch a file (change time modified)

Описание методов

__construct() публичный Метод

Construct a File instance
public __construct ( string $key, Storage $storage ) : File
$key string File key
$storage Webiny\Component\Storage\Storage Storage to use
Результат File

delete() публичный Метод

public delete ( )

exists() публичный Метод

Check if file exists
public exists ( ) : boolean
Результат boolean

getAbsolutePath() публичный Метод

If storage driver does not support absolute paths (cloud storage) returns file key
public getAbsolutePath ( ) : string
Результат string

getContents() публичный Метод

public getContents ( )

getKey() публичный Метод

public getKey ( )

getSize() публичный Метод

Get file size in bytes
public getSize ( ) : integer | null
Результат integer | null Number of bytes or null

getStorage() публичный Метод

public getStorage ( )

getTimeModified() публичный Метод

public getTimeModified ( $asDateTimeObject = false )

getUrl() публичный Метод

public getUrl ( )

isDirectory() публичный Метод

Need this method for easier checks when looping through directories.
public isDirectory ( ) : boolean
Результат boolean

rename() публичный Метод

public rename ( $newKey )

setContents() публичный Метод

public setContents ( $contents, $append = false )

touch() публичный Метод

Touch a file (change time modified)
public touch ( )

Описание свойств

$contents защищенное свойство

protected $contents

$isDirectory защищенное свойство

protected $isDirectory

$key защищенное свойство

protected $key

$size защищенное свойство

protected $size

$storage защищенное свойство

protected Storage,Webiny\Component\Storage $storage
Результат Webiny\Component\Storage\Storage

$timeModified защищенное свойство

protected $timeModified

$url защищенное свойство

protected $url