47 $this->filters[] = $filter;
59 $this->filters = array();
67 return $this->
callAsset(__FUNCTION__, array($additionalFilter));
74 return $this->
callAsset(__FUNCTION__, array($additionalFilter));
84 $this->
callAsset(__FUNCTION__, array($content));
109 $this->
callAsset(__FUNCTION__, array($targetPath));
129 $this->
callAsset(__FUNCTION__, array($values));
134 private function callAsset($method, $arguments = array())
138 return call_user_func_array(array(
$asset, $method), $arguments);
145 while ($filter = array_shift($this->filters)) {
146 $asset->ensureFilter($filter);
156 $asset = $this->am->get($this->name);
A reference to an asset in the asset manager.
ensureFilter(FilterInterface $filter)
Ensures the current asset includes the supplied filter.
getTargetPath()
Returns the URL for the current asset.
setValues(array $values)
Sets the values for the asset's variables.
setContent($content)
Sets the content of the current asset.
callAsset($method, $arguments=array())
dump(FilterInterface $additionalFilter=null)
Applies dump filters and returns the asset as a string.
getSourceRoot()
Returns an absolute path or URL to the source asset's root directory.
load(FilterInterface $additionalFilter=null)
Loads the asset into memory and applies load filters.
getContent()
Returns the loaded content of the current asset.
getFilters()
Returns an array of filters currently applied.
getSourcePath()
Returns the relative path for the source asset.
clearFilters()
Clears all filters from the current asset.
getVars()
Returns an array of variable names for this asset.
getValues()
Returns the current values for this asset.
getSourceDirectory()
Returns the asset's source directory.
__construct(AssetManager $am, $name)
getLastModified()
Returns the time the current asset was last modified.
setTargetPath($targetPath)
Sets the URL for the current asset.
An exception for terminatinating execution or to throw for unit testing.
An asset has a mutable URL and content and can be loaded and dumped.
A filter manipulates an asset at load and dump.