function callback_entity_info_language

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

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

Code

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

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/callback_entity_info_language/7.x