You are here

public function EntityDrupalWrapper::getIdentifier in Entity API 7

Returns the identifier of the wrapped entity.

Overrides EntityStructureWrapper::getIdentifier

See also

entity_id()

2 calls to EntityDrupalWrapper::getIdentifier()
EntityDrupalWrapper::access in includes/entity.wrapper.inc
Note that this method checks property access, but can be used for checking entity access *only* if the wrapper is not a property (i.e. has no parent wrapper). To be safe, better use EntityDrupalWrapper::entityAccess() for checking entity access.
EntityDrupalWrapper::debugIdentifierLocation in includes/entity.wrapper.inc
Returns a string to use to identify this wrapper in error messages.

File

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

Class

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

Code

public function getIdentifier() {
  return $this
    ->dataAvailable() ? $this
    ->value(array(
    'identifier' => TRUE,
  )) : NULL;
}