class download_count_views_handler_field_count in Download Count 6.2
Download count per file views field handler.
Hierarchy
- class \download_count_views_handler_field_count extends \views_handler_field_numeric
Expanded class hierarchy of download_count_views_handler_field_count
1 string reference to 'download_count_views_handler_field_count'
- download_count_views_data in includes/
download_count.views.inc - Implementation of hook_views_data().
File
- includes/
download_count_views_handler_field_count.inc, line 11 - Download count per file views handler.
View source
class download_count_views_handler_field_count extends views_handler_field_numeric {
function query() {
$this->table_alias = $this
->ensure_my_table();
if (empty($this->relationship)) {
$sql = "SELECT COUNT(dc.fid) FROM {download_count} dc WHERE dc.fid = " . $this->table_alias . ".fid";
$this->field_alias = $this->query
->add_field(NULL, "(" . $sql . ")", $this->table_alias . '_' . $this->field);
}
else {
$sql = "SELECT COUNT(dc.fid) FROM {download_count} dc WHERE dc.fid = " . $this->relationship . ".fid";
$this->field_alias = $this->query
->add_field(NULL, "(" . $sql . ")", $this->relationship . '_' . $this->field);
}
}
}