Commit 01a33182 authored by Dries's avatar Dries

- Patch #299176 by chx, Crell: added example of hook_query_alter to API documentation.

parent ff9b6c61
...@@ -1451,14 +1451,17 @@ function hook_schema_alter(&$schema) { ...@@ -1451,14 +1451,17 @@ function hook_schema_alter(&$schema) {
* *
* @see hook_query_TAG_alter() * @see hook_query_TAG_alter()
* @see node_query_node_access_alter() * @see node_query_node_access_alter()
* * @see QueryAlterableInterface
* @see SelectQueryInterface
* @param $query * @param $query
* A Query object describing the composite parts of a SQL query. * A Query object describing the composite parts of a SQL query.
* @return * @return
* None. * None.
*/ */
function hook_query_alter(QueryAlterableInterface $query) { function hook_query_alter(QueryAlterableInterface $query) {
if ($query->hasTag('micro_limit')) {
$query->range(0, 2);
}
} }
/** /**
...@@ -1466,6 +1469,8 @@ function hook_query_alter(QueryAlterableInterface $query) { ...@@ -1466,6 +1469,8 @@ function hook_query_alter(QueryAlterableInterface $query) {
* *
* @see hook_query_alter() * @see hook_query_alter()
* @see node_query_node_access_alter() * @see node_query_node_access_alter()
* @see QueryAlterableInterface
* @see SelectQueryInterface
* *
* @param $query * @param $query
* An Query object describing the composite parts of a SQL query. * An Query object describing the composite parts of a SQL query.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment