8.3.x EntityType.php public EntityType::getKey($key)
8.0.x EntityType.php public EntityType::getKey($key)
8.1.x EntityType.php public EntityType::getKey($key)
8.2.x EntityType.php public EntityType::getKey($key)
8.4.x EntityType.php public EntityType::getKey($key)

Gets a specific entity key.

Parameters

string $key: The name of the entity key to return.

Return value

string|bool The entity key, or FALSE if it does not exist.

Overrides EntityTypeInterface::getKey

See also

self::getKeys()

File

core/lib/Drupal/Core/Entity/EntityType.php, line 371

Class

EntityType
Provides an implementation of an entity type and its metadata.

Namespace

Drupal\Core\Entity

Code

public function getKey($key) {
  $keys = $this->getKeys();
  return isset($keys[$key]) ? $keys[$key] : FALSE;
}