You are here

protected function Entity::defaultLabel in Entity API 7

Defines the entity label if the 'entity_class_label' callback is used.

Specify 'entity_class_label' as 'label callback' in hook_entity_info() to let the entity label point to this method. Override this in order to implement a custom default label.

1 call to Entity::defaultLabel()
Entity::label in includes/entity.inc
Returns the label of the entity.
1 method overrides Entity::defaultLabel()
EntityClass::defaultLabel in tests/entity_test.module
Specifies the default label, which is picked up by label() by default.

File

includes/entity.inc, line 298
Provides a base class for entities.

Class

Entity
A common class for entities.

Code

protected function defaultLabel() {

  // Add in the translated specified label property.
  return $this
    ->getTranslation($this->entityInfo['entity keys']['label']);
}