You are here

final class ViewsQueryAlterEvent in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/views_event_dispatcher/src/Event/Views/ViewsQueryAlterEvent.php \Drupal\views_event_dispatcher\Event\Views\ViewsQueryAlterEvent

Class ViewsQueryAlterEvent.

Hierarchy

Expanded class hierarchy of ViewsQueryAlterEvent

2 files declare their use of ViewsQueryAlterEvent
ExampleViewsEventSubscribers.php in examples/ExampleViewsEventSubscribers.php
views_event_dispatcher.module in modules/views_event_dispatcher/views_event_dispatcher.module
Views event dispatcher submodule.

File

modules/views_event_dispatcher/src/Event/Views/ViewsQueryAlterEvent.php, line 12

Namespace

Drupal\views_event_dispatcher\Event\Views
View source
final class ViewsQueryAlterEvent extends AbstractViewsEvent {

  /**
   * 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() : QueryPluginBase {
    return $this->query;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
AbstractViewsEvent::$view private property The view.
AbstractViewsEvent::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 AbstractViewsEvent::__construct