From 0c33e8638845d4e8617d92776e95eac86c3e2e2a Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 14 Nov 2010 22:07:57 +0000 Subject: #885014 by bojanz, chx: Fixed add missing pager and tablesort query support to EntityFieldQuery. --- modules/system/system.api.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/system') diff --git a/modules/system/system.api.php b/modules/system/system.api.php index e7a5f06b6..8a67cddff 100644 --- a/modules/system/system.api.php +++ b/modules/system/system.api.php @@ -350,6 +350,13 @@ function hook_entity_delete($entity, $type) { * engines. Also, the default implementation presumes entities are stored in * SQL, but the execute callback could instead query any other entity storage, * local or remote. + * + * Note the $query->altered attribute which is TRUE in case the query has + * already been altered once. This happens with cloned queries. + * If there is a pager, then such a cloned query will be executed to count + * all elements. This query can be detected by checking for + * ($query->pager && $query->count), allowing the driver to return 0 from + * the count query and disable the pager. */ function hook_entity_query_alter($query) { $query->executeCallback = 'my_module_query_callback'; -- cgit v1.2.3