function views_handler_argument::summary_name_field
3.x views_handler_argument.inc | views_handler_argument::summary_name_field() |
2.x views_handler_argument.inc | views_handler_argument::summary_name_field() |
Add the name field, which is the field displayed in summary queries. This is often used when the argument is numeric.
3 calls to views_handler_argument::summary_name_field()
- views_handler_argument::summary_query in handlers/
views_handler_argument.inc - Build the info for the summary query.
- views_handler_argument_many_to_one::summary_query in handlers/
views_handler_argument_many_to_one.inc - Build the info for the summary query.
- views_handler_argument_string::summary_query in handlers/
views_handler_argument_string.inc - Build the summary query based on a string
File
- handlers/
views_handler_argument.inc, line 845 - @todo.
Class
- views_handler_argument
- Base class for arguments.
Code
function summary_name_field() {
// Add the 'name' field. For example, if this is a uid argument, the
// name field would be 'name' (i.e, the username).
if (isset($this->name_table)) {
// if the alias is different then we're probably added, not ensured,
// so look up the join and add it instead.
if ($this->table_alias != $this->name_table) {
$j = views_get_table_join($this->name_table, $this->table);
if ($j) {
$join = clone $j;
$join->left_table = $this->table_alias;
$this->name_table_alias = $this->query->add_table($this->name_table, $this->relationship, $join);
}
}
else {
$this->name_table_alias = $this->query->ensure_table($this->name_table, $this->relationship);
}
}
else {
$this->name_table_alias = $this->table_alias;
}
if (isset($this->name_field)) {
$this->name_alias = $this->query->add_field($this->name_table_alias, $this->name_field);
}
else {
$this->name_alias = $this->base_alias;
}
}