function views_plugin_query_default::set_count_field

Same name in other branches
  1. 7.x-3.x plugins/views_plugin_query_default.inc \views_plugin_query_default::set_count_field()

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

File

plugins/views_plugin_query_default.inc, line 146

Class

views_plugin_query_default
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,
    );
}