You are here

class views_handler_field_hosting_package_site_count in Hosting 6.2

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

Hierarchy

Expanded class hierarchy of views_handler_field_hosting_package_site_count

1 string reference to 'views_handler_field_hosting_package_site_count'
hosting_package_views_data in package/views/hosting_package.views.inc
Implementation of hook_views_data().

File

package/views/views_handler_field_hosting_package_site_count.inc, line 8

View source
class views_handler_field_hosting_package_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);
  }

}

Members