You are here

public function QueryInterface::addTag in Search API 8

Sets the given tag on this query.

Tags are strings that categorize 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.

The call will be ignored if the tag is already set on this query.

Parameters

string $tag: The tag to set.

Return value

$this

See also

hook_search_api_query_TAG_alter()

1 method overrides QueryInterface::addTag()
Query::addTag in src/Query/Query.php
Sets the given tag on this query.

File

src/Query/QueryInterface.php, line 478

Class

QueryInterface
Represents a search query on a Search API index.

Namespace

Drupal\search_api\Query

Code

public function addTag($tag);