コード例 #1
0
 /**
  * @param User $user
  *
  * @return string
  */
 private function getTranslatedUserPosition(User $user)
 {
     $position = $user->getPosition();
     /** @var UserTranslation $translation */
     foreach ($user->getTranslations()->getValues() as $translation) {
         if ($translation->getField() == 'position' && $translation->getLocale() == 'en') {
             $position = $translation->getContent();
         }
     }
     return $position;
 }