Random.php in Views (for Drupal 7) 8.3
Definition of Drupal\views\Plugin\views\sort\Random.
Namespace
Drupal\views\Plugin\views\sortFile
lib/Drupal/views/Plugin/views/sort/Random.phpView source
<?php
/**
* @file
* Definition of Drupal\views\Plugin\views\sort\Random.
*/
namespace Drupal\views\Plugin\views\sort;
use Drupal\Core\Annotation\Plugin;
/**
* Handle a random sort.
*
* @Plugin(
* id = "random"
* )
*/
class Random extends SortPluginBase {
public function query() {
$this->query
->add_orderby('rand');
}
public function buildOptionsForm(&$form, &$form_state) {
parent::buildOptionsForm($form, $form_state);
$form['order']['#access'] = FALSE;
}
}