You are here

views_handler_sort_random.inc in Views (for Drupal 7) 7.3

Definition of views_handler_sort_random.

File

handlers/views_handler_sort_random.inc
View source
<?php

/**
 * @file
 * Definition of views_handler_sort_random.
 */

/**
 * Handle a random sort.
 *
 * @ingroup views_sort_handlers
 */
class views_handler_sort_random extends views_handler_sort {

  /**
   * {@inheritdoc}
   */
  public function query() {
    $this->query
      ->add_orderby('rand');
  }

  /**
   * {@inheritdoc}
   */
  public function options_form(&$form, &$form_state) {
    parent::options_form($form, $form_state);
    $form['order']['#access'] = FALSE;
  }

}

Classes

Namesort descending Description
views_handler_sort_random Handle a random sort.