You are here

class PublicHeartbeat in Heartbeat 6.3

Same name and namespace in other branches
  1. 6.4 includes/publicheartbeat.inc \PublicHeartbeat

Class PublicHeartbeat Concrete class to prepare messages for all users in the site of whom the heartbeat is set to public

Hierarchy

Expanded class hierarchy of PublicHeartbeat

1 string reference to 'PublicHeartbeat'
heartbeat_heartbeat_register_access_types in ./heartbeat.module
Implementation of hook_heartbeat_register_access_types()

File

includes/publicheartbeat.inc, line 10

View source
class PublicHeartbeat extends HeartbeatAccess {

  /**
   * Implementation of dressUpMessages().
   *
   * @param object HeartbeatParser $heartbeat
   *   The state of the viewed message sets
   * @return object HeartbeatParser $heartbeat
   */
  public function dressUpMessages(HeartbeatParser $heartbeat) {
    $heartbeatInfo = $heartbeat
      ->get_info();
    $heartbeatInfo->uid = 0;
    $heartbeatInfo->limit_view = variable_get('heartbeat_block_public_items_max', 25);
    $heartbeatInfo->user_relations = $heartbeatInfo->uid;
    $heartbeat
      ->set_info($heartbeatInfo);
    $sql = $heartbeatInfo->sql_start;

    // logic to fetch messages public to all
    $sql .= " AND ua.uid > 0  AND ua.access > 0 ";
    $sql .= $heartbeatInfo->sql_end;
    $result = db_query_range($sql, $heartbeatInfo->language, $heartbeatInfo->start_time, 0, $heartbeatInfo->limit_sql);
    while ($heartbeat_row = db_fetch_object($result)) {
      $heartbeat->raw_messages[$heartbeat_row->uaid] = $heartbeat_row;
    }
    return $heartbeat;
  }

}

Members