3 namespace Drupal\views\Plugin\views\sort;
5 use Drupal\Core\Cache\CacheableDependencyInterface;
6 use Drupal\Core\Cache\UncacheableDependencyTrait;
7 use Drupal\Core\Form\FormStateInterface;
10 * Handle a random sort.
12 * @ViewsSort("random")
14 class Random extends SortPluginBase implements CacheableDependencyInterface {
16 use UncacheableDependencyTrait;
21 public function usesGroupBy() {
25 public function query() {
26 $this->query->addOrderBy('rand');
29 public function buildOptionsForm(&$form, FormStateInterface $form_state) {
30 parent::buildOptionsForm($form, $form_state);
31 $form['order']['#access'] = FALSE;