class clientsQuery in Web Service Clients 6
Same name and namespace in other branches
- 7 clients/clients_views/clientsQuery.inc \clientsQuery
For now this is an extension of the views_query, I'm not sure if it should remain so.
Hierarchy
- class \views_object
- class \views_plugin
- class \views_plugin_query
- class \views_plugin_query_default
- class \clientsQuery
- class \views_plugin_query_default
- class \views_plugin_query
- class \views_plugin
Expanded class hierarchy of clientsQuery
2 string references to 'clientsQuery'
- clients_views_views_data in clients/
clients_views/ clients_views.module - clients_views_views_plugins in clients/
clients_views/ clients_views.module - Implementation of hook_views_plugins
File
- clients/
clients_views/ clientsQuery.inc, line 12 - Using devseed extendr module as a base... http://devseed.svn.cvsdude.com/sandbox/drupal-6/extendr/
View source
class clientsQuery extends views_plugin_query_default {
var $args = array();
var $method = '';
// possibly remove?
function init($table, $field) {
$this->args['extras'] = array();
$this->method = '';
// don't think default method applies to clients
}
/**
* Generate queries
*
* - Fields don't matter here, they are dealt with purely at the display level.
*
* @param $get_count
* We don't use this at all as the flickr api returns this automatically.
*/
function query($get_count = FALSE) {
}
/**
* @todo make this lie less.
*/
function ensure_table() {
return TRUE;
}
function set_method($m, $a) {
$this->method = $m;
$this->args += $a;
}
/**
* @todo Investigate adding fields dynamically from response - e.g. remote cck.
*
* function add_field($table, $field, $alias = '', $params = NULL) {
* $extras = array(
* 'date_upload' => 'dateupload',
* );
* if (array_key_exists($field, $extras)) {
* $this->args['extras'][] = $field;
* $alias = $extras[$field];
* }
* return parent::add_field($table, $field, $alias, $params);
* }
*/
/**
* Execute a call
*/
function execute(&$view) {
$this->args['extras'] = implode(',', $this->args['extras']);
if (!empty($view->pager['items_per_page'])) {
$this->args['per_page'] = $view->pager['items_per_page'];
}
else {
$this->args['per_page'] = 500;
// upper limit?
}
// What page was requested:
$pager_page_array = isset($_GET['page']) ? explode(',', $_GET['page']) : array();
if (!empty($pager_page_array[$view->pager['element']])) {
$page = intval($pager_page_array[$view->pager['element']]);
$this->args['page'] = $page;
}
$resource = clients_resource_load($view->base_table);
// override $resource with $this->args
// pass params back to resource
$args = array();
/**
* matches view argument names ($view->argument) to
* argument input values ($view->args)
*/
foreach (array_keys($view->argument) as $key => $val) {
$args[$val] = $view->args[$key];
}
if ($view->query->pager->options['items_per_page']) {
$args['limit'] = $view->query->pager->options['items_per_page'];
}
if ($view->query->pager->options['offset']) {
$args['offset'] = $view->query->pager->options['offset'];
}
clients_setparams($resource, $args);
$result = clients_call($resource);
$view->result = $result[0]->data;
/**
* Removed a bunch of pager code here - may need to go back in though should probably be handled in clients module
*/
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
clientsQuery:: |
property | |||
clientsQuery:: |
property | |||
clientsQuery:: |
function |
@todo make this lie less. Overrides views_plugin_query_default:: |
||
clientsQuery:: |
function |
Execute a call Overrides views_plugin_query_default:: |
||
clientsQuery:: |
function |
Constructor; Create the basic query object and fill with default values. Overrides views_plugin_query_default:: |
||
clientsQuery:: |
function |
Generate queries Overrides views_plugin_query_default:: |
||
clientsQuery:: |
function | |||
views_object:: |
property | Handler's definition | ||
views_object:: |
property | Except for displays, options for the object will be held here. | 1 | |
views_object:: |
function | Views handlers use a special construct function so that we can more easily construct them with variable arguments. | 6 | |
views_object:: |
function | 2 | ||
views_object:: |
function | 1 | ||
views_object:: |
function | |||
views_object:: |
function | Set default options on this object. Called by the constructor in a complex chain to deal with backward compatibility. | 1 | |
views_object:: |
function | Set default options. For backward compatibility, it sends the options array; this is a feature that will likely disappear at some point. | ||
views_object:: |
function | Let the handler know what its full definition is. | ||
views_object:: |
function | Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. | ||
views_object:: |
function | Unpack a single option definition. | ||
views_object:: |
function | Unpacks each handler to store translatable texts. | ||
views_object:: |
function | |||
views_plugin:: |
property | The current used views display. | ||
views_plugin:: |
property | The plugin type of this plugin, for example style or query. | ||
views_plugin:: |
property |
The top object of a view. Overrides views_object:: |
1 | |
views_plugin:: |
function | Provide a list of additional theme functions for the theme information page | ||
views_plugin:: |
function | Provide a full list of possible theme templates used by this style. | ||
views_plugin:: |
function | Validate that the plugin is correct and can be saved. | 2 | |
views_plugin_query:: |
function |
Handle any special handling on the validate form. Overrides views_plugin:: |
||
views_plugin_query:: |
function |
Validate the options form. Overrides views_plugin:: |
||
views_plugin_query:: |
function | Render the pager, if necessary. | ||
views_plugin_query:: |
function | Control how all WHERE and HAVING groups are put together. | ||
views_plugin_query:: |
function | Set a LIMIT on the query, specifying a maximum number of results. | ||
views_plugin_query:: |
function | Set an OFFSET on the query, specifying a number of results to skip | ||
views_plugin_query:: |
function | Create a new grouping for the WHERE or HAVING clause. | ||
views_plugin_query:: |
function | |||
views_plugin_query_default:: |
property | A flag as to whether or not to make the primary field distinct. | ||
views_plugin_query_default:: |
property | An array of fields. | ||
views_plugin_query_default:: |
property | A simple array of group by clauses. | ||
views_plugin_query_default:: |
property | The default operator to use when connecting the WHERE groups. May be AND or OR. | ||
views_plugin_query_default:: |
property | |||
views_plugin_query_default:: |
property | An array of sections of the HAVING query. Each section is in itself an array of pieces and a flag as to whether or not it should be AND or OR. | ||
views_plugin_query_default:: |
property | The table header to use for tablesort. This matters because tablesort needs to modify the query and needs the header. | ||
views_plugin_query_default:: |
property | A simple array of order by clauses. | ||
views_plugin_query_default:: |
property |
The current used pager plugin. Overrides views_plugin_query:: |
||
views_plugin_query_default:: |
property | Holds an array of relationships, which are aliases of the primary table that represent different ways to join the same table in. | ||
views_plugin_query_default:: |
property | Holds an array of tables and counts added so that we can create aliases | ||
views_plugin_query_default:: |
property | A list of tables in the order they should be added, keyed by alias. | ||
views_plugin_query_default:: |
property | An array of sections of the WHERE query. Each section is in itself an array of pieces and a flag as to whether or not it should be AND or OR. | ||
views_plugin_query_default:: |
function | Add a field to the query table, possibly with an alias. This will automatically call ensure_table to make sure the required table exists, *unless* $table is unset. | ||
views_plugin_query_default:: |
function | Add a simple GROUP BY clause to the query. The caller is responsible for ensuring that the fields are fully qualified and the table is properly added. | ||
views_plugin_query_default:: |
function | Add a simple HAVING clause to the query. The caller is responsible for ensuring that all fields are fully qualified (TABLE.FIELD) and that the table and an appropriate GROUP BY already exist in the query. | ||
views_plugin_query_default:: |
function | Add an ORDER BY clause to the query. | ||
views_plugin_query_default:: |
function | A relationship is an alternative endpoint to a series of table joins. Relationships must be aliases of the primary table and they must join either to the primary table or to a pre-existing relationship. | ||
views_plugin_query_default:: |
function |
Add a signature to the query, if such a thing is feasible. Overrides views_plugin_query:: |
||
views_plugin_query_default:: |
function | Add a table to the query, ensuring the path exists. | ||
views_plugin_query_default:: |
function | Add a simple WHERE clause to the query. The caller is responsible for ensuring that all fields are fully qualified (TABLE.FIELD) and that the table already exists in the query. | ||
views_plugin_query_default:: |
function | Fix a join to adhere to the proper relationship; the left table can vary based upon what relationship items are joined in on. | ||
views_plugin_query_default:: |
function |
Let modules modify the query just prior to finalizing it. Overrides views_plugin_query:: |
||
views_plugin_query_default:: |
function |
Builds the necessary info to execute the query. Overrides views_plugin_query:: |
||
views_plugin_query_default:: |
function | Remove all fields that may've been added; primarily used for summary mode where we're changing the query because we didn't get data we needed. | ||
views_plugin_query_default:: |
function | |||
views_plugin_query_default:: |
function | Construct the "WHERE" or "HAVING" part of the query. | ||
views_plugin_query_default:: |
function | Wrapper method for db_fetch_object(). | ||
views_plugin_query_default:: |
function | Wrapper method for db_query(). | ||
views_plugin_query_default:: |
function | Wrapper method for db_query_range(). | ||
views_plugin_query_default:: |
function | Wrapper method for db_result(). | ||
views_plugin_query_default:: |
function | Wrapper method for db_set_active(). | ||
views_plugin_query_default:: |
function | Make sure that the specified table can be properly linked to the primary table in the JOINs. This function uses recursion. If the tables needed to complete the path back to the primary table are not in the query they will be added, but additional… | ||
views_plugin_query_default:: |
function |
Get aggregation info for group by queries. Overrides views_plugin_query:: |
||
views_plugin_query_default:: |
function |
Return info to base the uniqueness of the result on. Overrides views_plugin_query:: |
||
views_plugin_query_default:: |
function | Retrieve join data from the larger join data cache. | ||
views_plugin_query_default:: |
function |
Return preview info. Overrides views_plugin_query:: |
||
views_plugin_query_default:: |
function | Get the information associated with a table. | ||
views_plugin_query_default:: |
function | Get the arguments attached to the WHERE and HAVING clauses of this query. | ||
views_plugin_query_default:: |
function | |||
views_plugin_query_default:: |
function |
Add settings for the ui. Overrides views_plugin_query:: |
||
views_plugin_query_default:: |
function |
Information about options for all kinds of purposes will be held here. Overrides views_object:: |
||
views_plugin_query_default:: |
function | Add a table to the query without ensuring the path. | ||
views_plugin_query_default:: |
function | Set what field the query will count() on for paging. | ||
views_plugin_query_default:: |
function | Set the base field to be distinct. | ||
views_plugin_query_default:: |
function | Set the table header; used for click-sorting because it's needed info to modify the ORDER BY clause. |