1 entity.query.inc public EntityFieldQuery::addMetaData($key, $object)

Adds additional metadata to the query.

Sometimes a query may need to provide additional contextual data for the alter hook. The alter hook implementations may then use that information to decide if and how to take action.


$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

EntityFieldQuery: The called object.


core/modules/entity/entity.query.inc, line 728
Entity query API.


Retrieves entities matching a given set of conditions.


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