diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-04-20 07:42:22 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-04-20 07:42:22 +0000 |
commit | 01a33182a53a0b2a4c793107cabc155756063dae (patch) | |
tree | 9e6bdefeee85eb97aee5b23a39161030bbcc8c76 /modules/system/system.api.php | |
parent | ff9b6c611e1e1a804602f6a03692453268ee8076 (diff) | |
download | brdo-01a33182a53a0b2a4c793107cabc155756063dae.tar.gz brdo-01a33182a53a0b2a4c793107cabc155756063dae.tar.bz2 |
- Patch #299176 by chx, Crell: added example of hook_query_alter to API documentation.
Diffstat (limited to 'modules/system/system.api.php')
-rw-r--r-- | modules/system/system.api.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php index 639d3dad9..96cecdf19 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -1451,14 +1451,17 @@ function hook_schema_alter(&$schema) { * * @see hook_query_TAG_alter() * @see node_query_node_access_alter() - * + * @see QueryAlterableInterface + * @see SelectQueryInterface * @param $query * A Query object describing the composite parts of a SQL query. * @return * None. */ 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) { * * @see hook_query_alter() * @see node_query_node_access_alter() + * @see QueryAlterableInterface + * @see SelectQueryInterface * * @param $query * An Query object describing the composite parts of a SQL query. |