AssetCollection
in package
implements
IteratorAggregate, AssetCollectionInterface
A collection of assets.
Tags
Interfaces, Classes and Traits
- IteratorAggregate
- AssetCollectionInterface
- An asset collection.
Table of Contents
- $assets : mixed
- $clones : mixed
- $content : mixed
- $filters : mixed
- $sourceRoot : mixed
- $targetPath : mixed
- $values : mixed
- $vars : mixed
- __clone() : mixed
- __construct() : mixed
- Constructor.
- add() : mixed
- Adds an asset to the current collection.
- all() : array<string|int, mixed>
- Returns all child assets.
- clearFilters() : mixed
- dump() : mixed
- ensureFilter() : mixed
- getContent() : mixed
- getFilters() : mixed
- getIterator() : mixed
- Returns an iterator for looping recursively over unique leaves.
- getLastModified() : int|null
- Returns the highest last-modified value of all assets in the current collection.
- getSourceDirectory() : mixed
- getSourcePath() : mixed
- getSourceRoot() : mixed
- getTargetPath() : mixed
- getValues() : mixed
- getVars() : mixed
- load() : mixed
- removeLeaf() : bool
- Removes a leaf.
- replaceLeaf() : bool
- Replaces an existing leaf with a new one.
- setContent() : mixed
- setTargetPath() : mixed
- setValues() : mixed
Properties
$assets
private
mixed
$assets
$clones
private
mixed
$clones
$content
private
mixed
$content
$filters
private
mixed
$filters
$sourceRoot
private
mixed
$sourceRoot
$targetPath
private
mixed
$targetPath
$values
private
mixed
$values
$vars
private
mixed
$vars
Methods
__clone()
public
__clone() : mixed
Return values
mixed —__construct()
Constructor.
public
__construct([array<string|int, mixed> $assets = array() ][, array<string|int, mixed> $filters = array() ][, string $sourceRoot = null ][, array<string|int, mixed> $vars = array() ]) : mixed
Parameters
- $assets : array<string|int, mixed> = array()
-
Assets for the current collection
- $filters : array<string|int, mixed> = array()
-
Filters for the current collection
- $sourceRoot : string = null
-
The root directory
- $vars : array<string|int, mixed> = array()
Return values
mixed —add()
Adds an asset to the current collection.
public
add(AssetInterface $asset) : mixed
Parameters
- $asset : AssetInterface
-
An asset
Return values
mixed —all()
Returns all child assets.
public
all() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of AssetInterface objects
clearFilters()
public
clearFilters() : mixed
Return values
mixed —dump()
public
dump([FilterInterface $additionalFilter = null ]) : mixed
Parameters
- $additionalFilter : FilterInterface = null
Return values
mixed —ensureFilter()
public
ensureFilter(FilterInterface $filter) : mixed
Parameters
- $filter : FilterInterface
Return values
mixed —getContent()
public
getContent() : mixed
Return values
mixed —getFilters()
public
getFilters() : mixed
Return values
mixed —getIterator()
Returns an iterator for looping recursively over unique leaves.
public
getIterator() : mixed
Return values
mixed —getLastModified()
Returns the highest last-modified value of all assets in the current collection.
public
getLastModified() : int|null
Return values
int|null —A UNIX timestamp
getSourceDirectory()
public
getSourceDirectory() : mixed
Return values
mixed —getSourcePath()
public
getSourcePath() : mixed
Return values
mixed —getSourceRoot()
public
getSourceRoot() : mixed
Return values
mixed —getTargetPath()
public
getTargetPath() : mixed
Return values
mixed —getValues()
public
getValues() : mixed
Return values
mixed —getVars()
public
getVars() : mixed
Return values
mixed —load()
public
load([FilterInterface $additionalFilter = null ]) : mixed
Parameters
- $additionalFilter : FilterInterface = null
Return values
mixed —removeLeaf()
Removes a leaf.
public
removeLeaf(AssetInterface $needle[, mixed $graceful = false ]) : bool
Parameters
- $needle : AssetInterface
- $graceful : mixed = false
-
Whether the failure should return false or throw an exception
Return values
bool —Whether the asset has been found
replaceLeaf()
Replaces an existing leaf with a new one.
public
replaceLeaf(AssetInterface $needle, AssetInterface $replacement[, mixed $graceful = false ]) : bool
Parameters
- $needle : AssetInterface
-
The current asset to replace
- $replacement : AssetInterface
-
The new asset
- $graceful : mixed = false
-
Whether the failure should return false or throw an exception
Return values
bool —Whether the asset has been found
setContent()
public
setContent(mixed $content) : mixed
Parameters
- $content : mixed
Return values
mixed —setTargetPath()
public
setTargetPath(mixed $targetPath) : mixed
Parameters
- $targetPath : mixed
Return values
mixed —setValues()
public
setValues(array<string|int, mixed> $values) : mixed
Parameters
- $values : array<string|int, mixed>