You are here

public function EntityDrupalWrapper::entityKey in Entity API 7

Returns the name of the key used by the entity for given entity key.

Parameters

$name: One of 'id', 'name', 'bundle' or 'revision'.

Return value

string The name of the key used by the entity.

File

includes/entity.wrapper.inc, line 933
Provides wrappers allowing easy usage of the entity metadata.

Class

EntityDrupalWrapper
Provides a wrapper for entities registrered in hook_entity_info().

Code

public function entityKey($name) {
  return isset($this->entityInfo['entity keys'][$name]) ? $this->entityInfo['entity keys'][$name] : FALSE;
}