Same filename in this branch
- 10 core/lib/Drupal/Component/Utility/Random.php
- 10 core/modules/views/src/Plugin/views/sort/Random.php
- 10 core/tests/Drupal/TestTools/Random.php
Same filename and directory in other branches
- 8.9.x core/modules/views/src/Plugin/views/sort/Random.php
- 9 core/modules/views/src/Plugin/views/sort/Random.php
Namespace
Drupal\views\Plugin\views\sort
File
core/modules/views/src/Plugin/views/sort/Random.php
View source
<?php
namespace Drupal\views\Plugin\views\sort;
use Drupal\Core\Cache\CacheableDependencyInterface;
use Drupal\Core\Cache\UncacheableDependencyTrait;
use Drupal\Core\Form\FormStateInterface;
use Drupal\views\Attribute\ViewsSort;
class Random extends SortPluginBase implements CacheableDependencyInterface {
use UncacheableDependencyTrait;
public function usesGroupBy() {
return FALSE;
}
public function query() {
$this->query
->addOrderBy('rand');
}
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['order']['#access'] = FALSE;
}
}
Classes