ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
A collection of assets. More...
Public Member Functions | |
__construct ($assets=array(), $filters=array(), $sourceRoot=null, array $vars=array()) | |
Constructor. More... | |
__clone () | |
all () | |
Returns all child assets. More... | |
add (AssetInterface $asset) | |
Adds an asset to the current collection. More... | |
removeLeaf (AssetInterface $needle, $graceful=false) | |
Removes a leaf. More... | |
replaceLeaf (AssetInterface $needle, AssetInterface $replacement, $graceful=false) | |
Replaces an existing leaf with a new one. More... | |
ensureFilter (FilterInterface $filter) | |
Ensures the current asset includes the supplied filter. More... | |
getFilters () | |
Returns an array of filters currently applied. More... | |
clearFilters () | |
Clears all filters from the current asset. More... | |
load (FilterInterface $additionalFilter=null) | |
Loads the asset into memory and applies load filters. More... | |
dump (FilterInterface $additionalFilter=null) | |
Applies dump filters and returns the asset as a string. More... | |
getContent () | |
Returns the loaded content of the current asset. More... | |
setContent ($content) | |
Sets the content of the current asset. More... | |
getSourceRoot () | |
Returns an absolute path or URL to the source asset's root directory. More... | |
getSourcePath () | |
Returns the relative path for the source asset. More... | |
getSourceDirectory () | |
Returns the asset's source directory. More... | |
getTargetPath () | |
Returns the URL for the current asset. More... | |
setTargetPath ($targetPath) | |
Sets the URL for the current asset. More... | |
getLastModified () | |
Returns the highest last-modified value of all assets in the current collection. More... | |
getIterator () | |
Returns an iterator for looping recursively over unique leaves. More... | |
getVars () | |
Returns an array of variable names for this asset. More... | |
setValues (array $values) | |
Sets the values for the asset's variables. More... | |
getValues () | |
Returns the current values for this asset. More... | |
Private Attributes | |
$assets | |
$filters | |
$sourceRoot | |
$targetPath | |
$content | |
$clones | |
$vars | |
$values | |
A collection of assets.
Definition at line 24 of file AssetCollection.php.
Assetic\Asset\AssetCollection::__construct | ( | $assets = array() , |
|
$filters = array() , |
|||
$sourceRoot = null , |
|||
array | $vars = array() |
||
) |
Constructor.
array | $assets | Assets for the current collection |
array | $filters | Filters for the current collection |
string | $sourceRoot | The root directory |
array | $vars |
Definition at line 43 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$assets, Assetic\Asset\AssetCollection\$filters, Assetic\Asset\AssetCollection\$sourceRoot, Assetic\Asset\AssetCollection\$vars, Assetic\Asset\AssetCollection\add(), and array.
Assetic\Asset\AssetCollection::__clone | ( | ) |
Definition at line 57 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$filters.
Assetic\Asset\AssetCollection::add | ( | AssetInterface | $asset | ) |
Adds an asset to the current collection.
AssetInterface | $asset | An asset |
Implements Assetic\Asset\AssetCollectionInterface.
Definition at line 68 of file AssetCollection.php.
Referenced by Assetic\Asset\AssetCollection\__construct(), and Assetic\Asset\GlobAsset\initialize().
Assetic\Asset\AssetCollection::all | ( | ) |
Returns all child assets.
Implements Assetic\Asset\AssetCollectionInterface.
Definition at line 63 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$assets.
Assetic\Asset\AssetCollection::clearFilters | ( | ) |
Clears all filters from the current asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 128 of file AssetCollection.php.
Assetic\Asset\AssetCollection::dump | ( | FilterInterface | $additionalFilter = null | ) |
Applies dump filters and returns the asset as a string.
You may provide an additional filter to apply during dump.
Dumping an asset should not change its state.
If the current asset has not been loaded yet, it should be automatically loaded at this time.
FilterInterface | $additionalFilter | An additional filter |
Implements Assetic\Asset\AssetInterface.
Definition at line 146 of file AssetCollection.php.
References array.
Assetic\Asset\AssetCollection::ensureFilter | ( | FilterInterface | $filter | ) |
Ensures the current asset includes the supplied filter.
FilterInterface | $filter | A filter |
Implements Assetic\Asset\AssetInterface.
Definition at line 118 of file AssetCollection.php.
Assetic\Asset\AssetCollection::getContent | ( | ) |
Returns the loaded content of the current asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 157 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$content.
Assetic\Asset\AssetCollection::getFilters | ( | ) |
Returns an array of filters currently applied.
Implements Assetic\Asset\AssetInterface.
Definition at line 123 of file AssetCollection.php.
Assetic\Asset\AssetCollection::getIterator | ( | ) |
Returns an iterator for looping recursively over unique leaves.
Definition at line 215 of file AssetCollection.php.
Assetic\Asset\AssetCollection::getLastModified | ( | ) |
Returns the highest last-modified value of all assets in the current collection.
Implements Assetic\Asset\AssetInterface.
Definition at line 195 of file AssetCollection.php.
Assetic\Asset\AssetCollection::getSourceDirectory | ( | ) |
Returns the asset's source directory.
The source directory is the directory the asset was located in and can be used to resolve references relative to an asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 176 of file AssetCollection.php.
Assetic\Asset\AssetCollection::getSourcePath | ( | ) |
Returns the relative path for the source asset.
This value can be combined with the asset's source root (if both are non-null) to get something compatible with file_get_contents().
For example:
Implements Assetic\Asset\AssetInterface.
Definition at line 172 of file AssetCollection.php.
Assetic\Asset\AssetCollection::getSourceRoot | ( | ) |
Returns an absolute path or URL to the source asset's root directory.
This value should be an absolute path to a directory in the filesystem, an absolute URL with no path, or null.
For example:
Implements Assetic\Asset\AssetInterface.
Definition at line 167 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$sourceRoot.
Referenced by Assetic\Asset\GlobAsset\initialize().
Assetic\Asset\AssetCollection::getTargetPath | ( | ) |
Returns the URL for the current asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 180 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$targetPath.
Assetic\Asset\AssetCollection::getValues | ( | ) |
Returns the current values for this asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 234 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$values.
Referenced by Assetic\Asset\GlobAsset\initialize().
Assetic\Asset\AssetCollection::getVars | ( | ) |
Returns an array of variable names for this asset.
Implements Assetic\Asset\AssetInterface.
Definition at line 220 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$vars.
Referenced by Assetic\Asset\GlobAsset\initialize().
Assetic\Asset\AssetCollection::load | ( | FilterInterface | $additionalFilter = null | ) |
Loads the asset into memory and applies load filters.
You may provide an additional filter to apply during load.
FilterInterface | $additionalFilter | An additional filter |
Implements Assetic\Asset\AssetInterface.
Definition at line 134 of file AssetCollection.php.
References array.
Assetic\Asset\AssetCollection::removeLeaf | ( | AssetInterface | $leaf, |
$graceful = false |
|||
) |
Removes a leaf.
AssetInterface | $leaf | The leaf to remove |
Boolean | $graceful | Whether the failure should return false or throw an exception |
Implements Assetic\Asset\AssetCollectionInterface.
Definition at line 73 of file AssetCollection.php.
References array, and Assetic\Asset\AssetCollectionInterface\removeLeaf().
Assetic\Asset\AssetCollection::replaceLeaf | ( | AssetInterface | $needle, |
AssetInterface | $replacement, | ||
$graceful = false |
|||
) |
Replaces an existing leaf with a new one.
AssetInterface | $needle | The current asset to replace |
AssetInterface | $replacement | The new asset |
Boolean | $graceful | Whether the failure should return false or throw an exception |
Implements Assetic\Asset\AssetCollectionInterface.
Definition at line 95 of file AssetCollection.php.
References array, and Assetic\Asset\AssetCollectionInterface\replaceLeaf().
Assetic\Asset\AssetCollection::setContent | ( | $content | ) |
Sets the content of the current asset.
Filters can use this method to change the content of the asset.
string | $content | The asset content |
Implements Assetic\Asset\AssetInterface.
Definition at line 162 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$content.
Assetic\Asset\AssetCollection::setTargetPath | ( | $targetPath | ) |
Sets the URL for the current asset.
string | $targetPath | A web URL where the asset will be dumped |
Implements Assetic\Asset\AssetInterface.
Definition at line 185 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$targetPath.
Assetic\Asset\AssetCollection::setValues | ( | array | $values | ) |
Sets the values for the asset's variables.
array | $values |
Implements Assetic\Asset\AssetInterface.
Definition at line 225 of file AssetCollection.php.
References Assetic\Asset\AssetCollection\$values.
|
private |
Definition at line 26 of file AssetCollection.php.
Referenced by Assetic\Asset\AssetCollection\__construct(), and Assetic\Asset\AssetCollection\all().
|
private |
Definition at line 31 of file AssetCollection.php.
|
private |
Definition at line 30 of file AssetCollection.php.
Referenced by Assetic\Asset\AssetCollection\getContent(), and Assetic\Asset\AssetCollection\setContent().
|
private |
Definition at line 27 of file AssetCollection.php.
Referenced by Assetic\Asset\AssetCollection\__clone(), Assetic\Asset\GlobAsset\__construct(), and Assetic\Asset\AssetCollection\__construct().
|
private |
Definition at line 28 of file AssetCollection.php.
Referenced by Assetic\Asset\AssetCollection\__construct(), and Assetic\Asset\AssetCollection\getSourceRoot().
|
private |
Definition at line 29 of file AssetCollection.php.
Referenced by Assetic\Asset\AssetCollection\getTargetPath(), and Assetic\Asset\AssetCollection\setTargetPath().
|
private |
Definition at line 33 of file AssetCollection.php.
Referenced by Assetic\Asset\AssetCollection\getValues(), and Assetic\Asset\AssetCollection\setValues().
|
private |
Definition at line 32 of file AssetCollection.php.
Referenced by Assetic\Asset\GlobAsset\__construct(), Assetic\Asset\AssetCollection\__construct(), and Assetic\Asset\AssetCollection\getVars().