public function postLoad(LifecycleEventArgs $args)
    {
        $entity = $args->getEntity();

        if (!$entity instanceof TranslatableInterface) {
            return;
        }

        $entity->initializeTranslations();
        $entity->setCurrentLocale($this->localeProvider->getCurrentLocale());
        $entity->setFallbackLocale($this->localeProvider->getFallbackLocale());
    }
public function postLoad(LifecycleEventArgs $args)
    {
        $entity = $args->getEntity();

        if (!$entity instanceof TranslatableInterface) {
            return;
        }

        $entity->initializeTranslations();
        $entity->setCurrentLocale($this->localeProvider->getCurrentLocale());
        $entity->setFallbackLocale($this->localeProvider->getFallbackLocale());
    }
public function postLoad ( LifecycleEventArgs $ args ) { $ entity = $ args -> getEntity ( ) ; if ( ! $ entity instanceof TranslatableInterface ) { return ; } $ entity -> initializeTranslations ( ) ; $ entity -> setCurrentLocale ( $ this -> localeProvider -> getCurrentLocale ( ) ) ; $ entity -> setFallbackLocale ( $ this -> localeProvider -> getFallbackLocale ( ) ) ; }
Translatable post load event handler.

Initializes the translations and sets the current and fallback locales.

@param LifecycleEventArgs $args
Translatable post load event handler .