function hosting_db_server_handler_filter_db_server_type::get_value_options in Hosting 7.3
Same name and namespace in other branches
- 6.2 db_server/hosting_db_server_handler_filter_db_server_type.inc \hosting_db_server_handler_filter_db_server_type::get_value_options()
- 7.4 db_server/hosting_db_server_handler_filter_db_server_type.inc \hosting_db_server_handler_filter_db_server_type::get_value_options()
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
This can use a guard to be used to reduce database hits as much as possible.
Return value
Return the stored values in $this->value_options if someone expects it.
Overrides views_handler_filter_in_operator::get_value_options
File
- db_server/
hosting_db_server_handler_filter_db_server_type.inc, line 11 - Define a views filter handler to filter by database type.
Class
- hosting_db_server_handler_filter_db_server_type
- Filter handler to allowing filtering by database type.
Code
function get_value_options() {
if (!isset($this->value_options)) {
$this->value_title = t('DB Sever Type');
$result = db_query("SELECT DISTINCT(db_type) FROM {hosting_db_server}");
while ($db_server = $result
->fetch()) {
$options[$db_server->db_type] = $db_server->db_type;
}
$this->value_options = $options;
}
}