You are here

class AssetOptimizationEvent in Advanced CSS/JS Aggregation 8.3

Same name and namespace in other branches
  1. 8.4 src/Asset/AssetOptimizationEvent.php \Drupal\advagg\Asset\AssetOptimizationEvent

AssetOptimizationEvent data holder.

Hierarchy

Expanded class hierarchy of AssetOptimizationEvent

Related topics

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

... See full list

File

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

Namesort descending Modifiers Type Description Overrides
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.