You are here

public function QueryBase::addMetaData in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/Query/QueryBase.php \Drupal\Core\Entity\Query\QueryBase::addMetaData()

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

$key: The unique identifier for this piece of metadata. Must be a string that follows the same rules as any other PHP identifier.

$object: The additional data to add to the query. May be any valid PHP variable.

Return value

\Drupal\Core\Database\Query\AlterableInterface The called object.

Overrides AlterableInterface::addMetaData

File

core/lib/Drupal/Core/Entity/Query/QueryBase.php, line 369
Contains \Drupal\Core\Entity\Query\QueryBase.

Class

QueryBase
The base entity query class.

Namespace

Drupal\Core\Entity\Query

Code

public function addMetaData($key, $object) {
  $this->alterMetaData[$key] = $object;
  return $this;
}