You are here

protected function SingleActivity::createQuery in Heartbeat 7

Override the createQuery method.

Return value

HeartbeatParser object

Overrides HeartbeatStream::createQuery

File

streams/singleactivity.inc, line 28
Defines a stream for one activity message.

Class

SingleActivity
Concrete class SingleActivity Defines a stream for one activity message.

Code

protected function createQuery() {
  $this->query = db_select('heartbeat_activity', 'ha');
  $this->query
    ->fields('ha');

  // Override the permission based on the user profile status.
  $this->query
    ->leftJoin('heartbeat_user_templates', 'hut', ' ha.uid = hut.uid AND ha.message_id = hut.message_id ');
  $this->query
    ->addField('hut', 'status', 'access_status');
  $this->query
    ->condition('ha.uaid', $this->latest_activity_id);
  $this->query
    ->where(" ha.language IN (:languages) ", array(
    ':languages' => $this
      ->getCurrentLanguages(),
  ));
  $this->config->variables['build_mode'] = 'full';
}