\app\framework\Component\Storage\FileFile

Summary

Methods
Properties
Constants
__construct()
getStorage()
getKey()
getTimeModified()
setContents()
getSize()
touch()
getContent()
rename()
delete()
getAbsolutePath()
No public properties found
No constants found
eventManager()
$storage
$key
$timeModified
N/A
No private methods found
No private properties found
N/A

Properties

$storage

$storage : 

Type

$key

$key : 

Type

$timeModified

$timeModified : 

Type

Methods

__construct()

__construct(string  $key, \app\framework\Component\Storage\Storage  $storage) 

Construct a File instance

Parameters

string $key

File key

\app\framework\Component\Storage\Storage $storage

Storage to use

getKey()

getKey() : string

Get file key

Returns

string

setContents()

setContents(mixed  $contents, boolean  $append = false) : boolean

Set file contents (writes contents to storage)<br />

Fires an event StorageEvent::FILE_SAVED after the file content was written.

Parameters

mixed $contents
boolean $append

Returns

boolean —

| int

getSize()

getSize() : integer|null

Get file size in bytes

Returns

integer|null —

Number of bytes or null

touch()

touch() : $this

Touch a file (change time modified)

Returns

$this

getContent()

getContent() : mixed

Get file contents

Returns

mixed

rename()

rename(  $newName) : mixed

Cpt. Obviously approves that this method renames the File.

Parameters

$newName

Returns

mixed

delete()

delete() : mixed

Deletes the File.

Returns

mixed

getAbsolutePath()

getAbsolutePath() : mixed

Returns

mixed