PHP Класс 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.
Наследование: implements Countabl\Countable, implements Iterato\Iterator
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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 ( )

Описание методов

__construct() публичный Метод

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

append() публичный Метод

Append an asset to the collection.
public append ( AssetTarget $target ) : void
$target AssetTarget The target to append
Результат void

contains() публичный Метод

Check whether or not the collection contains the named asset.
public contains ( string $name ) : boolean
$name string The name of the asset you want.
Результат boolean

count() публичный Метод

Get the length of the collection.
public count ( ) : integer
Результат integer

current() публичный Метод

public current ( )

get() публичный Метод

Get an asset from the collection
public get ( string $name ) : null | AssetTarget
$name string The name of the asset you want.
Результат null | AssetTarget Either null or the asset target.

key() публичный Метод

public key ( )

next() публичный Метод

public next ( )

remove() публичный Метод

Remove an asset from the collection
public remove ( string $name ) : void
$name string The name of the asset you want to remove
Результат void

rewind() публичный Метод

public rewind ( )

valid() публичный Метод

public valid ( )

Описание свойств

$factory защищенное свойство

A factory instance that can be used to lazily build targets.
protected Factory,MiniAsset $factory
Результат Factory

$index защищенное свойство

The current position.
protected int $index
Результат integer

$indexed защищенное свойство

The assets indexed by name.
protected array $indexed
Результат array

$items защищенное свойство

The assets indexed numerically.
protected array $items
Результат array