You are here

final class ViewsQueryAlterEvent in Hook Event Dispatcher 8

Class ViewsQueryAlterEvent.

@package Drupal\hook_event_dispatcher\Event\Views

Hierarchy

Expanded class hierarchy of ViewsQueryAlterEvent

2 files declare their use of ViewsQueryAlterEvent
ExampleViewsEventSubscribers.php in src/Example/ExampleViewsEventSubscribers.php
hook_event_dispatcher.module in ./hook_event_dispatcher.module
Hook event dispatcher module.

File

src/Event/Views/ViewsQueryAlterEvent.php, line 14

Namespace

Drupal\hook_event_dispatcher\Event\Views
View source
final class ViewsQueryAlterEvent extends BaseViewsEvent {

  /**
   * The query.
   *
   * @var \Drupal\views\Plugin\views\query\QueryPluginBase
   */
  private $query;

  /**
   * ViewsPreExecuteEevent constructor.
   *
   * @param \Drupal\views\ViewExecutable $view
   *   The view.
   * @param \Drupal\views\Plugin\views\query\QueryPluginBase $query
   *   The query.
   */
  public function __construct(ViewExecutable $view, QueryPluginBase $query) {
    parent::__construct($view);
    $this->query = $query;
  }

  /**
   * Get the query.
   *
   * @return \Drupal\views\Plugin\views\query\QueryPluginBase
   *   The query.
   */
  public function getQuery() {
    return $this->query;
  }

  /**
   * Get the dispatcher type.
   *
   * @return string
   *   The dispatcher type.
   */
  public function getDispatcherType() {
    return HookEventDispatcherInterface::VIEWS_QUERY_ALTER;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BaseViewsEvent::$view private property The view.
BaseViewsEvent::getView public function Get the view.
ViewsQueryAlterEvent::$query private property The query.
ViewsQueryAlterEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
ViewsQueryAlterEvent::getQuery public function Get the query.
ViewsQueryAlterEvent::__construct public function ViewsPreExecuteEevent constructor. Overrides BaseViewsEvent::__construct