function Random::query

Same name and namespace in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/sort/Random.php \Drupal\views\Plugin\views\sort\Random::query()
  2. 10 core/modules/views/src/Plugin/views/sort/Random.php \Drupal\views\Plugin\views\sort\Random::query()
  3. 11.x core/modules/views/src/Plugin/views/sort/Random.php \Drupal\views\Plugin\views\sort\Random::query()

Overrides SortPluginBase::query

File

core/modules/views/src/Plugin/views/sort/Random.php, line 25

Class

Random
Handle a random sort.

Namespace

Drupal\views\Plugin\views\sort

Code

public function query() {
    $this->query
        ->addOrderBy('rand');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.