function hosting_package_handler_field_site_count::query in Hosting 7.3
Same name and namespace in other branches
- 7.4 package/includes/views/handlers/hosting_package_handler_field_site_count.inc \hosting_package_handler_field_site_count::query()
Called to add the field to a query.
Overrides views_handler_field::query
File
- package/
includes/ views/ handlers/ hosting_package_handler_field_site_count.inc, line 10
Class
- hosting_package_handler_field_site_count
- A handler to provide a count of sites using a given package.
Code
function query() {
parent::query();
$this->query
->add_field(NULL, '(SELECT count(iid) FROM {hosting_package_instance} pi WHERE pi.package_id = node_hosting_package_instance_nid AND pi.platform = ' . $this->view->args[0] . ' AND pi.status = 1)', 'site_count');
}