You are here

class CommandExecuteEvent in Update helper 8

Same name and namespace in other branches
  1. 2.x 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
GenerateConfigurationUpdateCommand.php in src/Command/GenerateConfigurationUpdateCommand.php

File

src/Events/CommandExecuteEvent.php, line 13

Namespace

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

  /**
   * Console command for this event.
   *
   * @var \Drupal\Console\Core\Command\Command
   */
  protected $command;

  /**
   * Module name.
   *
   * @var string
   */
  protected $module;

  /**
   * Update number.
   *
   * @var int
   */
  protected $updateNumber;

  /**
   * Command options.
   *
   * @var array
   */
  protected $commandOptions;

  /**
   * Flag if execution was successful.
   *
   * @var bool
   */
  protected $successful;

  /**
   * Command execute event constructor.
   *
   * @param \Drupal\Console\Core\Command\Command $command
   *   Command that for which this event is triggered.
   * @param string $module
   *   Module name.
   * @param int $update_number
   *   Update number.
   * @param array $command_options
   *   Command options.
   * @param bool $successful
   *   Successful execution of command.
   */
  public function __construct(Command $command, $module, $update_number, array $command_options, $successful) {
    $this->command = $command;
    $this->module = $module;
    $this->updateNumber = $update_number;
    $this->commandOptions = $command_options;
    $this->successful = $successful;
  }

  /**
   * Get drupal console command.
   *
   * @return \Drupal\Console\Core\Command\Command
   *   Returns drupal console command.
   */
  public function getCommand() {
    return $this->command;
  }

  /**
   * Get module name.
   *
   * @return string
   *   Returns module name.
   */
  public function getModule() {
    return $this->module;
  }

  /**
   * Get update number.
   *
   * @return int
   *   Returns update number.
   */
  public function getUpdateNumber() {
    return $this->updateNumber;
  }

  /**
   * Get options.
   *
   * @return array
   *   Returns options.
   */
  public function getOptions() {
    return $this->commandOptions;
  }

  /**
   * Returns is command execution successful.
   *
   * @return bool
   *   Returns status of command execution.
   */
  public function getSuccessful() {
    return $this->successful;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommandExecuteEvent::$command protected property Console command for this event.
CommandExecuteEvent::$commandOptions protected property Command options.
CommandExecuteEvent::$module protected property Module name.
CommandExecuteEvent::$successful protected property Flag if execution was successful.
CommandExecuteEvent::$updateNumber protected property Update number.
CommandExecuteEvent::getCommand public function Get drupal console command.
CommandExecuteEvent::getModule public function Get module name.
CommandExecuteEvent::getOptions public function Get options.
CommandExecuteEvent::getSuccessful public function Returns is command execution successful.
CommandExecuteEvent::getUpdateNumber public function Get update number.
CommandExecuteEvent::__construct public function Command execute event constructor.