function activity_views_handler_field_message::query in Activity 6.2
Same name and namespace in other branches
- 7 views/views_handler_fields.inc \activity_views_handler_field_message::query()
override the query to add in our stuff
File
- views/
activity_views_handler_field_message.inc, line 10 - : renders the message field for the given user
Class
- activity_views_handler_field_message
- @file: renders the message field for the given user
Code
function query() {
$this
->ensure_my_table();
// join in the personal message table
$this->personal_msg_table = $this->query
->ensure_table('activity_personal_messages', $this->relationship);
// use the personal message if there is one otherwise use the non-personal message
$this->field_alias = $this->query
->add_field(NULL, "COALESCE({$this->personal_msg_table}.message, {$this->table_alias}.{$this->real_field})", $this->table_alias . '_' . $this->real_field);
}