Drupal 8  8.0.2
AlterableInterface Interface Reference
Inheritance diagram for AlterableInterface:

Public Member Functions

 addTag ($tag)
 
 hasTag ($tag)
 
 hasAllTags ()
 
 hasAnyTag ()
 
 addMetaData ($key, $object)
 
 getMetaData ($key)
 

Detailed Description

Interface for a query that can be manipulated via an alter hook.

Member Function Documentation

addMetaData (   $key,
  $object 
)

Adds additional metadata to the query.

Often, a query may need to provide additional contextual data to alter hooks. Alter hooks may then use that information to decide if and how to take action.

Parameters
$keyThe unique identifier for this piece of metadata. Must be a string that follows the same rules as any other PHP identifier.
$objectThe additional data to add to the query. May be any valid PHP variable.
Returns
The called object.

Implemented in QueryBase, Select, and SelectExtender.

addTag (   $tag)

Adds a tag to a query.

Tags are strings that identify a query. A query may have any number of tags. Tags are used to mark a query so that alter hooks may decide if they wish to take action. Tags should be all lower-case and contain only letters, numbers, and underscore, and start with a letter. That is, they should follow the same rules as PHP identifiers in general.

Parameters
$tagThe tag to add.
Returns
The called object.

Implemented in QueryBase, Select, and SelectExtender.

getMetaData (   $key)

Retrieves a given piece of metadata.

Parameters
$keyThe unique identifier for the piece of metadata to retrieve.
Returns
The previously attached metadata object, or NULL if one doesn't exist.

Implemented in QueryBase, Select, and SelectExtender.

hasAllTags ( )

Determines if a given query has all specified tags.

Parameters
$tagsA variable number of arguments, one for each tag to check.
Returns
TRUE if this query has been marked with all specified tags, FALSE otherwise.

Implemented in QueryBase, Select, and SelectExtender.

hasAnyTag ( )

Determines if a given query has any specified tag.

Parameters
$tagsA variable number of arguments, one for each tag to check.
Returns
TRUE if this query has been marked with at least one of the specified tags, FALSE otherwise.

Implemented in QueryBase, Select, and SelectExtender.

hasTag (   $tag)

Determines if a given query has a given tag.

Parameters
$tagThe tag to check.
Returns
TRUE if this query has been marked with this tag, FALSE otherwise.

Implemented in QueryBase, Select, and SelectExtender.


The documentation for this interface was generated from the following file: