hook_query_alter(Drupal\Core\Database\Query\AlterableInterface $query)
Perform alterations to a structured query.
Structured (aka dynamic) queries that have tags associated may be altered by any module before the query is executed.
$query: A Query object describing the composite parts of a SQL query.
node_query_node_access_alter()
AlterableInterface
SelectInterface
function hook_query_alter(Drupal\Core\Database\Query\AlterableInterface $query) { if ($query->hasTag('micro_limit')) { $query->range(0, 2); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!database.api.php/function/hook_query_alter/8.1.x