You are here

public function ViewsPhp::query in Views PHP 8

Same name in this branch
  1. 8 src/Plugin/views/filter/ViewsPhp.php \Drupal\views_php\Plugin\views\filter\ViewsPhp::query()
  2. 8 src/Plugin/views/sort/ViewsPhp.php \Drupal\views_php\Plugin\views\sort\ViewsPhp::query()
  3. 8 src/Plugin/views/field/ViewsPhp.php \Drupal\views_php\Plugin\views\field\ViewsPhp::query()

Called to add the field to a query.

Overrides FieldPluginBase::query

File

src/Plugin/views/field/ViewsPhp.php, line 153
Contains \Drupal\views_php\Plugin\views\field\ViewsPhp.

Class

ViewsPhp
A handler to provide a field that is constructed by the administrator using PHP.

Namespace

Drupal\views_php\Plugin\views\field

Code

public function query() {

  // Provide an field alias but don't actually alter the query.
  $this->field_alias = 'views_php_' . $this->position;

  // Inform views_php_views_pre_execute() to seize control over the query.
  $this->view->views_php = TRUE;
}