1 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.
File
- core/
modules/ views/ handlers/ views_handler_argument.inc, line 876 - @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;
}
}