From 01a33182a53a0b2a4c793107cabc155756063dae Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 20 Apr 2009 07:42:22 +0000 Subject: - Patch #299176 by chx, Crell: added example of hook_query_alter to API documentation. --- modules/system/system.api.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'modules/system/system.api.php') 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. -- cgit v1.2.3