Same name in other branches
  1. 6.0.x src/Asset/AssetOptimizationEvent.php \Drupal\advagg\Asset\AssetOptimizationEvent
  2. 8.x-3.x src/Asset/AssetOptimizationEvent.php \Drupal\advagg\Asset\AssetOptimizationEvent
  3. 8.x-4.x src/Asset/AssetOptimizationEvent.php \Drupal\advagg\Asset\AssetOptimizationEvent

AssetOptimizationEvent data holder.

Hierarchy

Expanded class hierarchy of AssetOptimizationEvent

Sujets associés

6 files declare their use of AssetOptimizationEvent
CssSubscriber.php dans advagg_old_ie_compatibility/src/EventSubscriber/CssSubscriber.php
InitSubscriber.php dans advagg_mod/src/EventSubscriber/InitSubscriber.php
MinificationSubscriber.php dans advagg_bundler/src/EventSubscriber/MinificationSubscriber.php
MinificationSubscriber.php dans advagg_css_minify/src/EventSubscriber/MinificationSubscriber.php
MinificationSubscriber.php dans advagg_js_minify/src/EventSubscriber/MinificationSubscriber.php

... See full list

Fichier

src/Asset/AssetOptimizationEvent.php, line 25

Namespace

Drupal\advagg\Asset
View source
class AssetOptimizationEvent extends Event {
    
    /**
     * The Event ID for css optimization.
     */
    const CSS = 'advagg.optimize_css';
    const JS = 'advagg.optimize_js';
    
    /**
     * The asset content.
     *
     * @var string
     */
    protected $content;
    
    /**
     * A core single asset definition array.
     *
     * @var array
     */
    protected $asset;
    
    /**
     * A single asset advagg cache array.
     *
     * @var array
     */
    protected $data;
    
    /**
     * AssetOptimizationEvent constructor.
     *
     * @param string $content
     *   The asset content.
     * @param array $asset
     *   The asset core definition array.
     * @param array $data
     *   The cache data about the asset.
     */
    public function __construct($content, array $asset, array $data) {
        $this->content = $content;
        $this->asset = $asset;
        $this->data = $data;
    }
    
    /**
     * Get the current content.
     *
     * @return string
     *   The current content.
     */
    public function getContent() {
        return $this->content;
    }
    
    /**
     * Set new content.
     *
     * @param string $content
     *   The new content.
     */
    public function setContent($content) {
        $this->content = $content;
    }
    
    /**
     * Get the asset array.
     *
     * @return array
     *   The current core asset definition array.
     */
    public function getAsset() {
        return $this->asset;
    }
    
    /**
     * Update the asset array.
     *
     * @param array $asset_array
     *   The updated asset definition array.
     */
    public function setAsset(array $asset_array) {
        $this->asset = $asset_array;
    }
    
    /**
     * Get the cache data.
     *
     * @return array
     *   The current cache data array.
     */
    public function getData() {
        return $this->data;
    }
    
    /**
     * Update the cache data.
     *
     * @param array $data
     *   The new cache data array.
     */
    public function setData(array $data) {
        $this->data = $data;
    }

}

Members

Titre Trier par ordre décroissant Modifiers Object type Résumé
AssetOptimizationEvent::$asset protected property A core single asset definition array.
AssetOptimizationEvent::$content protected property The asset content.
AssetOptimizationEvent::$data protected property A single asset advagg cache array.
AssetOptimizationEvent::CSS constant The Event ID for css optimization.
AssetOptimizationEvent::getAsset public function Get the asset array.
AssetOptimizationEvent::getContent public function Get the current content.
AssetOptimizationEvent::getData public function Get the cache data.
AssetOptimizationEvent::JS constant
AssetOptimizationEvent::setAsset public function Update the asset array.
AssetOptimizationEvent::setContent public function Set new content.
AssetOptimizationEvent::setData public function Update the cache data.
AssetOptimizationEvent::__construct public function AssetOptimizationEvent constructor.