public function EntityTranslationDefaultHandler::getTranslations in Entity Translation 7
Overrides EntityTranslationHandlerInterface::getTranslations
See also
EntityTranslationHandlerInterface::getTranslations()
11 calls to EntityTranslationDefaultHandler::getTranslations()
- EntityTranslationDefaultHandler::entityForm in includes/
translation.handler.inc - EntityTranslationDefaultHandler::entityFormLanguageWidget in includes/
translation.handler.inc - EntityTranslationDefaultHandler::entityFormSubmit in includes/
translation.handler.inc - EntityTranslationDefaultHandler::getLanguage in includes/
translation.handler.inc - EntityTranslationDefaultHandler::initOriginalTranslation in includes/
translation.handler.inc
File
- includes/
translation.handler.inc, line 661 - Default translation handler for the translation module.
Class
- EntityTranslationDefaultHandler
- Class implementing the default entity translation behaviours.
Code
public function getTranslations() {
if ($translations_key = $this
->getTranslationsKey()) {
// Lazy load translations if for some reason the wrapped entity did not go
// through hook_entity_load().
if (!isset($this->entity->{$translations_key})) {
$this
->loadTranslations();
}
return $this->entity->{$translations_key};
}
return self::emptyTranslations();
}