Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function EntityFieldQuery::addMetaData

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.

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

EntityFieldQuery The called object.

File

includes/entity.inc, line 1174

Class

EntityFieldQuery
Retrieves entities matching a given set of conditions.

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.