You are here

function hook_eck_entity_label in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7.2 eck.api.php \hook_eck_entity_label()

Change an entity's label dynamically.

More constrained versions of this hook also exist: hook_eck_entity_<entity_type>_label hook_eck_entity_<entity_type>_<bundle>_label

This hook is mainly useful for dynamic labels, or for using values in a field as labels.

If you are storing the label of the entity in a property already, you should modify the entity_info array's label key, instead of using this hook.

Parameters

Entity $entity: The entity object.

int $entity_id: The id of the entity.

Return value

mixed The label for the entity.

File

./eck.api.php, line 212
ECK's API documentation.

Code

function hook_eck_entity_label($entity, $entity_id) {
  return "Somethins that should be the label for this entity";
}