PHP Class MiniAsset\AssetCollection

Asset targets are lazily evaluated as they are fetched from the collection By using get() an AssetTarget and its dependent files will be created and verified.
Inheritance: implements Countabl\Countable, implements Iterato\Iterator
Datei anzeigen Open project: markstory/mini-asset Class Usage Examples

Protected Properties

Property Type Description
$factory Factory A factory instance that can be used to lazily build targets.
$index integer The current position.
$indexed array The assets indexed by name.
$items array The assets indexed numerically.

Public Methods

Method Description
__construct ( array $targets, Factory $factory ) Constructor. You can provide an array or any traversable object
append ( AssetTarget $target ) : void Append an asset to the collection.
contains ( string $name ) : boolean Check whether or not the collection contains the named asset.
count ( ) : integer Get the length of the collection.
current ( )
get ( string $name ) : null | AssetTarget Get an asset from the collection
key ( )
next ( )
remove ( string $name ) : void Remove an asset from the collection
rewind ( )
valid ( )

Method Details

__construct() public method

Constructor. You can provide an array or any traversable object
public __construct ( array $targets, Factory $factory )
$targets array
$factory Factory

append() public method

Append an asset to the collection.
public append ( AssetTarget $target ) : void
$target AssetTarget The target to append
return void

contains() public method

Check whether or not the collection contains the named asset.
public contains ( string $name ) : boolean
$name string The name of the asset you want.
return boolean

count() public method

Get the length of the collection.
public count ( ) : integer
return integer

current() public method

public current ( )

get() public method

Get an asset from the collection
public get ( string $name ) : null | AssetTarget
$name string The name of the asset you want.
return null | AssetTarget Either null or the asset target.

key() public method

public key ( )

next() public method

public next ( )

remove() public method

Remove an asset from the collection
public remove ( string $name ) : void
$name string The name of the asset you want to remove
return void

rewind() public method

public rewind ( )

valid() public method

public valid ( )

Property Details

$factory protected_oe property

A factory instance that can be used to lazily build targets.
protected Factory,MiniAsset $factory
return Factory

$index protected_oe property

The current position.
protected int $index
return integer

$indexed protected_oe property

The assets indexed by name.
protected array $indexed
return array

$items protected_oe property

The assets indexed numerically.
protected array $items
return array