8.x
8.x-UNSTABLE1
Any label callback defined in an entity now receives two arguments: $entity_type and $entity. This allows label callbacks that apply to multiple entity types.
In Drupal 7.2 and up, you can also use the added $entity_type parameter. Note that for backwards compatibility with Drupal 7.0 the parameter order is reversed.
Example:
<?php
function example_entity_info() {
...
$entities['example']['label callback'] = 'example_label';
return $entities;
}
// Drupal 7.0 and up:
function example_label($entity) {
...
}
// Drupal 7.2 and up:
function example_label($entity, $entity_type) {
...
}
// Drupal 8.x:
function example_label($entity_type, $entity) {
...
}
?>