You are here

public function SiteActivity::addViewQuery in Heartbeat 6.4

Function to add a part of a sql to a query built by views

Parameters

object $view The view handler object by reference to add our part to the query:

Overrides HeartbeatAccess::addViewQuery

File

modules/heartbeat_example/siteactivity.inc, line 40

Class

SiteActivity
Class SiteActivity Concrete class to prepare messages for whole site, to be customized UI wise

Code

public function addViewQuery(&$view) {

  // Make the sql limited to the access
  $field = "{$view->table_alias}.{$view->real_field}";
  $view->query
    ->add_where('andgroup', "{$field} > %d  AND {$view->table_alias}.access > 0", 0);
}