public function setLocale(User $user, $locale = 'en')
    {
        $user->setLocale($locale);
        $this->objectManager->persist($user);
        $this->objectManager->flush();
    }
public function setLocale(User $user, $locale = 'en')
    {
        $user->setLocale($locale);
        $this->objectManager->persist($user);
        $this->objectManager->flush();
    }
public function setLocale ( User $ user , $ locale = 'en' ) { $ user -> setLocale ( $ locale ) ; $ this -> objectManager -> persist ( $ user ) ; $ this -> objectManager -> flush ( ) ; }
Set the user locale.

@todo use crud instead
@todo REMOVE ME

@param \Claroline\CoreBundle\Entity\User $user
@param string                            $locale Language with format en, fr, es, etc
Set the user locale .