Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
01a33182
Commit
01a33182
authored
Apr 20, 2009
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#299176
by chx, Crell: added example of hook_query_alter to API documentation.
parent
ff9b6c61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
modules/system/system.api.php
modules/system/system.api.php
+7
-2
No files found.
modules/system/system.api.php
View file @
01a33182
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment