PHP 인터페이스 Webiny\Component\Storage\File\FileInterface

파일 보기 프로젝트 열기: Webiny/Framework

공개 메소드들

메소드 설명
__construct ( string $key, Storage $storage ) Constructor
delete ( ) : boolean Delete a file
getAbsolutePath ( ) : string Get absolute file path.
getContents ( ) : string | boolean Get file contents
getKey ( ) : string Get file key
getSize ( ) : integer | null Get file size in bytes
getStorage ( ) : Storage Get file storage
getTimeModified ( boolean $asDateTimeObject = false ) : integer | DateTimeObject Get time modified
getUrl ( ) : string Get file public URL
rename ( string $newKey ) : boolean Rename a file
setContents ( mixed $contents, boolean $append = false ) Set file contents (writes contents to storage)
touch ( ) Touch a file (change time modified)

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( string $key, Storage $storage )
$key string File key
$storage Webiny\Component\Storage\Storage Storage to use

delete() 공개 메소드

Fires an event StorageEvent::FILE_DELETED after the file was deleted.
public delete ( ) : boolean
리턴 boolean

getAbsolutePath() 공개 메소드

If storage driver does not support absolute paths (cloud storage) returns file key
public getAbsolutePath ( ) : string
리턴 string

getContents() 공개 메소드

Get file contents
public getContents ( ) : string | boolean
리턴 string | boolean String on success, false if could not read content

getKey() 공개 메소드

Get file key
public getKey ( ) : string
리턴 string

getSize() 공개 메소드

Get file size in bytes
public getSize ( ) : integer | null
리턴 integer | null Number of bytes or null

getStorage() 공개 메소드

Get file storage
public getStorage ( ) : Storage
리턴 Webiny\Component\Storage\Storage

getTimeModified() 공개 메소드

Get time modified
public getTimeModified ( boolean $asDateTimeObject = false ) : integer | DateTimeObject
$asDateTimeObject boolean
리턴 integer | DateTimeObject UNIX timestamp or DateTimeObject

getUrl() 공개 메소드

Get file public URL
public getUrl ( ) : string
리턴 string

rename() 공개 메소드

Fires an event StorageEvent::FILE_RENAMED after the file was renamed.
public rename ( string $newKey ) : boolean
$newKey string New file name
리턴 boolean

setContents() 공개 메소드

Fires an event StorageEvent::FILE_SAVED after the file content was written.
public setContents ( mixed $contents, boolean $append = false )
$contents mixed
$append boolean

touch() 공개 메소드

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