PHP Class Habari\MediaAsset

Show file Open project: habari/system

Public Properties

Property Type Description
$icon

Protected Properties

Property Type Description
$content
$filename
$is_dir
$mode
$path
$props

Public Methods

Method Description
__construct ( string $path, boolean $is_dir, array $properties = [], $icon = null ) MediaAsset constructor
__get ( string $name ) : mixed Retrieve attributes about this asset
__set ( string $name, mixed $value ) Set attributes about this asset
get_props ( )
load ( string $file ) Load the asset data from a file
put ( ) : boolean Shortcut for putting an asset into the correct silo based on its path
save ( string $file ) : boolean Save the asset data to a file
upload ( array $files ) Load the asset data from an upload

Protected Methods

Method Description
_get ( ) : mixed Return the content of the asset
_set ( mixed $content ) Set the content of this asset

Method Details

__construct() public method

MediaAsset constructor
public __construct ( string $path, boolean $is_dir, array $properties = [], $icon = null )
$path string The path of the asset
$is_dir boolean true if the asset is a directory
$properties array An associative array of property values

__get() public method

Retrieve attributes about this asset
public __get ( string $name ) : mixed
$name string The name of the property to retrieve
return mixed The value requested

__set() public method

Set attributes about this asset
public __set ( string $name, mixed $value )
$name string The name of the property to set
$value mixed The value to set

_get() protected method

Return the content of the asset
protected _get ( ) : mixed
return mixed The asset content

_set() protected method

Set the content of this asset
protected _set ( mixed $content )
$content mixed The asset content

get_props() public method

public get_props ( )

load() public method

Load the asset data from a file
public load ( string $file )
$file string The filename to load

put() public method

Shortcut for putting an asset into the correct silo based on its path
public put ( ) : boolean
return boolean True on success

save() public method

Save the asset data to a file
public save ( string $file ) : boolean
$file string The destination filename
return boolean True on success

upload() public method

Load the asset data from an upload
public upload ( array $files )
$files array The $_FILES array created when a file is uploaded

Property Details

$content protected property

protected $content

$filename protected property

protected $filename

$icon public property

public $icon

$is_dir protected property

protected $is_dir

$mode protected property

protected $mode

$path protected property

protected $path

$props protected property

protected $props