function callback_entity_info_language

7.x system.api.php callback_entity_info_language($entity, $entity_type)

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

drupal-7.x/modules/system/system.api.php, line 4782
Hooks provided by Drupal core and the System module.

Code

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