Add the name field, which is the field displayed in summary queries. This is often used when the argument is numeric.
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->tableAlias != $this->name_table) {
$j = HandlerBase::getTableJoin($this->name_table, $this->table);
if ($j) {
$join = clone $j;
$join->leftTable = $this->tableAlias;
$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->tableAlias;
}
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;
}
}