ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
Assetic\Asset\StringAsset Class Reference

Represents a string asset. More...

+ Inheritance diagram for Assetic\Asset\StringAsset:
+ Collaboration diagram for Assetic\Asset\StringAsset:

Public Member Functions

 __construct ($content, $filters=array(), $sourceRoot=null, $sourcePath=null)
 Constructor. More...
 
 load (FilterInterface $additionalFilter=null)
 Loads the asset into memory and applies load filters. More...
 
 setLastModified ($lastModified)
 
 getLastModified ()
 Returns the time the current asset was last modified. More...
 
- Public Member Functions inherited from Assetic\Asset\BaseAsset
 __construct ($filters=array(), $sourceRoot=null, $sourcePath=null, array $vars=array())
 Constructor. More...
 
 __clone ()
 
 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...
 
 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...
 
 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

 $string
 
 $lastModified
 

Additional Inherited Members

- Protected Member Functions inherited from Assetic\Asset\BaseAsset
 doLoad ($content, FilterInterface $additionalFilter=null)
 Encapsulates asset loading logic. More...
 

Detailed Description

Represents a string asset.

Author
Kris Wallsmith kris..nosp@m.wall.nosp@m.smith.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Definition at line 21 of file StringAsset.php.

Constructor & Destructor Documentation

◆ __construct()

Assetic\Asset\StringAsset::__construct (   $content,
  $filters = array(),
  $sourceRoot = null,
  $sourcePath = null 
)

Constructor.

Parameters
string$contentThe content of the asset
array$filtersFilters for the asset
string$sourceRootThe source asset root directory
string$sourcePathThe source asset path

Definition at line 34 of file StringAsset.php.

References Assetic\Asset\BaseAsset\$content, Assetic\Asset\BaseAsset\$filters, Assetic\Asset\BaseAsset\$sourcePath, and Assetic\Asset\BaseAsset\$sourceRoot.

35  {
36  $this->string = $content;
37 
38  parent::__construct($filters, $sourceRoot, $sourcePath);
39  }

Member Function Documentation

◆ getLastModified()

Assetic\Asset\StringAsset::getLastModified ( )

Returns the time the current asset was last modified.

Returns
integer|null A UNIX timestamp

Implements Assetic\Asset\AssetInterface.

Definition at line 51 of file StringAsset.php.

References Assetic\Asset\StringAsset\$lastModified.

52  {
53  return $this->lastModified;
54  }

◆ load()

Assetic\Asset\StringAsset::load ( FilterInterface  $additionalFilter = null)

Loads the asset into memory and applies load filters.

You may provide an additional filter to apply during load.

Parameters
FilterInterface$additionalFilterAn additional filter

Implements Assetic\Asset\AssetInterface.

Definition at line 41 of file StringAsset.php.

References Assetic\Asset\BaseAsset\doLoad().

42  {
43  $this->doLoad($this->string, $additionalFilter);
44  }
doLoad($content, FilterInterface $additionalFilter=null)
Encapsulates asset loading logic.
Definition: BaseAsset.php:84
+ Here is the call graph for this function:

◆ setLastModified()

Assetic\Asset\StringAsset::setLastModified (   $lastModified)

Definition at line 46 of file StringAsset.php.

References Assetic\Asset\StringAsset\$lastModified.

47  {
48  $this->lastModified = $lastModified;
49  }

Field Documentation

◆ $lastModified

Assetic\Asset\StringAsset::$lastModified
private

◆ $string

Assetic\Asset\StringAsset::$string
private

Definition at line 23 of file StringAsset.php.


The documentation for this class was generated from the following file: