Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes

MediaAsset Class Reference

List of all members.

Public Member Functions

 __construct ($path, $is_dir, $properties=array(), $icon=null)
 get_props ()
 __get ($name)
 __set ($name, $value)
 load ($file)
 save ($file)
 upload ($files)
 put ()

Public Attributes

const MODE_NONE = 0
const MODE_DATA = 1
const MODE_FILE = 2
const MODE_STREAM = 3
const MODE_UPLOAD = 4
 $icon = null

Protected Member Functions

 _get ()
 _set ($content)

Protected Attributes

 $path
 $is_dir
 $content = null
 $props = array()
 $filename
 $mode = self::MODE_NONE

Detailed Description

Definition at line 17 of file mediaasset.php.


Constructor & Destructor Documentation

MediaAsset::__construct ( path,
is_dir,
properties = array(),
icon = null 
)

MediaAsset constructor

Parameters:
string $path The path of the asset
boolean $is_dir true if the asset is a directory
array $properties An associative array of property values

Definition at line 40 of file mediaasset.php.


Member Function Documentation

MediaAsset::__get ( name  ) 

Retrieve attributes about this asset

Parameters:
string $name The name of the property to retrieve
Returns:
mixed The value requested

Definition at line 100 of file mediaasset.php.

MediaAsset::__set ( name,
value 
)

Set attributes about this asset

Parameters:
string $name The name of the property to set
mixed $value The value to set

Definition at line 132 of file mediaasset.php.

MediaAsset::_get (  )  [protected]

Return the content of the asset

Returns:
mixed The asset content

Definition at line 53 of file mediaasset.php.

Referenced by __get().

MediaAsset::_set ( content  )  [protected]

Set the content of this asset

Parameters:
mixed $content The asset content

Definition at line 77 of file mediaasset.php.

Referenced by __set().

MediaAsset::load ( file  ) 

Load the asset data from a file

Parameters:
string $file The filename to load

Definition at line 152 of file mediaasset.php.

MediaAsset::put (  ) 

Shortcut for putting an asset into the correct silo based on its path

Returns:
boolean True on success

Definition at line 202 of file mediaasset.php.

MediaAsset::save ( file  ) 

Save the asset data to a file

Parameters:
string $file The destination filename
Returns:
boolean True on success

Definition at line 164 of file mediaasset.php.

MediaAsset::upload ( files  ) 

Load the asset data from an upload

Parameters:
array $files The $_FILES array created when a file is uploaded

Definition at line 190 of file mediaasset.php.


The documentation for this class was generated from the following file: