You are here

class CommandExecuteEvent in Update helper 2.x

Same name and namespace in other branches
  1. 8 src/Events/CommandExecuteEvent.php \Drupal\update_helper\Events\CommandExecuteEvent

Event for command execute.

@package Drupal\update_helper\Events

Hierarchy

  • class \Drupal\update_helper\Events\CommandExecuteEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of CommandExecuteEvent

2 files declare their use of CommandExecuteEvent
CommandGcuSubscriber.php in modules/update_helper_checklist/src/Events/CommandGcuSubscriber.php
ConfigurationUpdate.php in src/Generators/ConfigurationUpdate.php

File

src/Events/CommandExecuteEvent.php, line 13

Namespace

Drupal\update_helper\Events
View source
class CommandExecuteEvent extends Event {

  /**
   * The collected variables.
   *
   * @var array
   */
  protected $vars;

  /**
   * Assets that should be generated.
   *
   * @var array
   */
  protected $assets = [];

  /**
   * Paths to look for template files.
   *
   * @var array
   */
  protected $templatePaths = [];

  /**
   * Command execute event constructor.
   *
   * @param array $vars
   *   The collected vars.
   */
  public function __construct(array $vars) {
    $this->vars = $vars;
  }

  /**
   * Get the collected vars.
   *
   * @return array
   *   All the collected vars.
   */
  public function getVars() {
    return $this->vars;
  }

  /**
   * Get the assets that should be generated.
   *
   * @return array
   *   Assets that should be generated.
   */
  public function getAssets() {
    return $this->assets;
  }

  /**
   * Add an asset.
   *
   * @param \DrupalCodeGenerator\Asset $asset
   *   The asset to add to the array.
   *
   * @return $this
   */
  public function addAsset(Asset $asset) {
    $this->assets[] = $asset;
    return $this;
  }

  /**
   * Add a template path.
   *
   * @param string $template_path
   *   The path for templates.
   *
   * @return $this
   */
  public function addTemplatePath($template_path) {
    $this->templatePaths[] = $template_path;
    return $this;
  }

  /**
   * Get all template paths.
   *
   * @return array
   *   An array of paths.
   */
  public function getTemplatePaths() {
    return $this->templatePaths;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommandExecuteEvent::$assets protected property Assets that should be generated.
CommandExecuteEvent::$templatePaths protected property Paths to look for template files.
CommandExecuteEvent::$vars protected property The collected variables.
CommandExecuteEvent::addAsset public function Add an asset.
CommandExecuteEvent::addTemplatePath public function Add a template path.
CommandExecuteEvent::getAssets public function Get the assets that should be generated.
CommandExecuteEvent::getTemplatePaths public function Get all template paths.
CommandExecuteEvent::getVars public function Get the collected vars.
CommandExecuteEvent::__construct public function Command execute event constructor.