DBTNG dynamic queries support the concept of tagging queries with additional information. This allows modules to determine which queries they want to work with and how they should be modified. You add a tag by simply calling the addTag
method, which has the following signature:
addTag($tag)
The tag parameter is the name of the tag you want to add. You can check whether a particular tag has been added to the query using the hasTag
, hasAllTags
, or hasAnyTag
methods.
There are several tags that are used in Drupal core, which may be useful to you in your modules. These include:
translatable
—indicates that the query contains translatable content.node_access
—indicates that the query should be restricted based on permissions defined for the node. This restriction is done by Drupal automatically when it encounters the tag.pagerDefault
—added by thePagerDefault
query extender to indicate that the query is being paginated.tablesort
—added by theTableSort
query extender to indicate...