You are here

function callback_entity_info_language in Drupal 7

Return the language code of the entity.

Callback for hook_entity_info().

The language callback is meant to be used primarily for temporary alterations of the property value.

Parameters

$entity: The entity for which to return the language.

$entity_type: The entity type; e.g., 'node' or 'user'.

Return value

The language code for the language of the entity.

See also

entity_language()

Related topics

File

modules/system/system.api.php, line 4909
Hooks provided by Drupal core and the System module.

Code

function callback_entity_info_language($entity, $entity_type) {
  return $entity->language;
}