function views_query::set_count_field

2.x query.inc views_query::set_count_field($table, $field, $alias = NULL)

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

File

includes/query.inc, line 125
query.inc Defines the query object which is the underlying layer in a View.

Class

views_query
Object used to create a SELECT 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,
  );
}