ViewsQueryAlterEvent.php in Hook Event Dispatcher 3.x
File
modules/views_event_dispatcher/src/Event/Views/ViewsQueryAlterEvent.php
View source
<?php
namespace Drupal\views_event_dispatcher\Event\Views;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\views\Plugin\views\query\QueryPluginBase;
use Drupal\views\ViewExecutable;
final class ViewsQueryAlterEvent extends AbstractViewsEvent {
private $query;
public function __construct(ViewExecutable $view, QueryPluginBase $query) {
parent::__construct($view);
$this->query = $query;
}
public function getQuery() : QueryPluginBase {
return $this->query;
}
public function getDispatcherType() : string {
return HookEventDispatcherInterface::VIEWS_QUERY_ALTER;
}
}