function views_handler::get_field

Same name in other branches
  1. 7.x-3.x includes/handlers.inc \views_handler::get_field()

Shortcut to get a handler's raw field value.

This should be overridden for handlers with formulae or other non-standard fields. Because this takes an argument, fields overriding this can just call return parent::get_field($formula)

6 calls to views_handler::get_field()
views_handler_argument_group_by_numeric::query in handlers/views_handler_argument_group_by_numeric.inc
Set up the query for this argument.
views_handler_argument_group_by_numeric::ui_name in handlers/views_handler_argument_group_by_numeric.inc
Return a string representing this handler's name in the UI.
views_handler_field_group_by_numeric::ui_name in handlers/views_handler_field_group_by_numeric.inc
Return a string representing this handler's name in the UI.
views_handler_filter_group_by_numeric::query in handlers/views_handler_filter_group_by_numeric.inc
Add this filter to the query.
views_handler_filter_group_by_numeric::ui_name in handlers/views_handler_filter_group_by_numeric.inc
Return a string representing this handler's name in the UI.

... See full list

File

includes/handlers.inc, line 357

Class

views_handler
Base handler, from which all the other handlers are derived. It creates a common interface to create consistency amongst handlers and data.

Code

function get_field($field = NULL) {
    if (!isset($field)) {
        if (!empty($this->formula)) {
            $field = $this->get_formula();
        }
        else {
            $field = $this->table_alias . '.' . $this->real_field;
        }
    }
    // If grouping, check to see if the aggregation method needs to modify the field.
    if ($this->view->display_handler
        ->use_group_by()) {
        $info = $this->query
            ->get_aggregation_info();
        if (!empty($info[$this->options['group_type']]['method']) && function_exists($info[$this->options['group_type']]['method'])) {
            return $info[$this->options['group_type']]['method']($this->options['group_type'], $field);
        }
    }
    return $field;
}