class hosting_package_handler_field_site_count

A handler to provide a count of sites using a given package.

Hierarchy

Expanded class hierarchy of hosting_package_handler_field_site_count

Members

File

package/includes/views/handlers/hosting_package_handler_field_site_count.inc, line 8

View source
class hosting_package_handler_field_site_count extends views_handler_field {

  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');
  }

  function render($values) {
    return $values->site_count;
  }

  function click_sort($order) {
    $this->query->add_orderby(NULL, NULL, $order, $this->field);
  }

}