You are here

function Sql::set_count_field in Views (for Drupal 7) 8.3

Set what field the query will count() on for paging.

File

lib/Drupal/views/Plugin/views/query/Sql.php, line 166
Definition of Drupal\views\Plugin\views\query\Sql.

Class

Sql
@todo.

Namespace

Drupal\views\Plugin\views\query

Code

function set_count_field($table, $field, $alias = NULL) {
  if (empty($alias)) {
    $alias = $table . '_' . $field;
  }
  $this->count_field = array(
    'table' => $table,
    'field' => $field,
    'alias' => $alias,
    'count' => TRUE,
  );
}