public function MembersActivity::addViewQuery in Heartbeat 6.4
Function to add a part of a sql to a query built by views UI
Parameters
object $view The view handler object by reference to add our part to the query:
Overrides HeartbeatAccess::addViewQuery
File
- modules/
og_activity/ membersactivity.inc, line 140
Class
- MembersActivity
- Class MembersActivity Concrete class to prepare messages for the current user and all of his/her relations.
Code
public function addViewQuery(&$view) {
$members = array();
$sql = og_list_users_sql(1, 0, NULL);
$res = db_query($sql, $this->_gid);
while ($row = db_fetch_object($res)) {
$members[] = $row->uid;
}
$sql = "{$view->table_alias}.uid IN (" . implode(',', $members) . ") ";
$view->query
->set_where_group('AND', 'extra');
$view->query
->add_where('extra', $sql);
}