You are here

abstract class AbstractThemeSuggestionsEvent in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/core_event_dispatcher/src/Event/Theme/AbstractThemeSuggestionsEvent.php \Drupal\core_event_dispatcher\Event\Theme\AbstractThemeSuggestionsEvent

Class AbstractThemeSuggestionsEvent.

Hierarchy

Expanded class hierarchy of AbstractThemeSuggestionsEvent

File

modules/core_event_dispatcher/src/Event/Theme/AbstractThemeSuggestionsEvent.php, line 11

Namespace

Drupal\core_event_dispatcher\Event\Theme
View source
abstract class AbstractThemeSuggestionsEvent extends Event implements EventInterface {

  /**
   * Array of suggestions.
   *
   * @var array
   */
  private $suggestions;

  /**
   * Variables.
   *
   * @var array
   */
  private $variables;

  /**
   * Hook name.
   *
   * @var string
   */
  private $hook;

  /**
   * AbstractThemeSuggestionsEvent constructor.
   *
   * @param array $suggestions
   *   Suggestions.
   * @param array $variables
   *   Variables.
   * @param string $hook
   *   Hook name.
   */
  public function __construct(array &$suggestions, array $variables, string $hook) {
    $this->suggestions =& $suggestions;
    $this->variables = $variables;
    $this->hook = $hook;
  }

  /**
   * Get suggestions.
   *
   * @return array
   *   Array of suggestions.
   */
  public function &getSuggestions() : array {
    return $this->suggestions;
  }

  /**
   * Get variables.
   *
   * @return array
   *   Array of variables.
   */
  public function getVariables() : array {
    return $this->variables;
  }

  /**
   * Get hook.
   *
   * @return string
   *   Name of the hook.
   */
  public function getHook() : string {
    return $this->hook;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractThemeSuggestionsEvent::$hook private property Hook name.
AbstractThemeSuggestionsEvent::$suggestions private property Array of suggestions.
AbstractThemeSuggestionsEvent::$variables private property Variables.
AbstractThemeSuggestionsEvent::getHook public function Get hook.
AbstractThemeSuggestionsEvent::getSuggestions public function Get suggestions.
AbstractThemeSuggestionsEvent::getVariables public function Get variables.
AbstractThemeSuggestionsEvent::__construct public function AbstractThemeSuggestionsEvent constructor.
EventInterface::getDispatcherType public function Get the dispatcher type. 75