function tripal_views_handler_filter_file_upload::query
2.x tripal_views_handler_filter_file_upload.inc | tripal_views_handler_filter_file_upload::query() |
3.x tripal_views_handler_filter_file_upload.inc | tripal_views_handler_filter_file_upload::query() |
1.x tripal_views_handler_filter_file_upload.inc | tripal_views_handler_filter_file_upload::query() |
Add this filter to the query.
Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.
Overrides views_handler_filter::query
File
- tripal_views/
views/ handlers/ tripal_views_handler_filter_file_upload.inc, line 63 - Contains tripal_views_handler_filter_file_upload filter handler
Class
- tripal_views_handler_filter_file_upload
- This Handler provides a file upload field by extending the views_handler_filter object.
Code
function query() {
$this->ensure_my_table();
$field = "$this->table.$this->real_field";
// get the form element values
$value = $this->value[0];
$values = $value['items_array'];
// trim all values supplied
foreach ($values as $k => $val) {
$values[$k] = trim($val);
}
// Determine the operator to use depending on # of items
if (sizeof($values)) {
$operator = 'IN';
}
else {
$operator = '=';
}
// if we have any items then add the where
if (!empty($values)) {
$this->query->add_where($this->options['group'], $field, $values, $operator);
}
}