Пример #1
0
 /**
  * Gibt ein Array mit den angeforderten Daten eines Benutzers zurück
  *
  * @param int $userId
  *
  * @return array
  */
 public function getUserInfo($userId = 0)
 {
     if (empty($userId) && $this->isAuthenticated() === true) {
         $userId = $this->getUserId();
     }
     $userId = (int) $userId;
     if (empty($this->userInfo[$userId])) {
         $countries = Country::worldCountries();
         $info = $this->userRepository->getOneById($userId);
         if (!empty($info)) {
             $info['country_formatted'] = !empty($info['country']) && isset($countries[$info['country']]) ? $countries[$info['country']] : '';
             $this->userInfo[$userId] = $info;
         }
     }
     return !empty($this->userInfo[$userId]) ? $this->userInfo[$userId] : [];
 }
Пример #2
0
 /**
  * @param string $defaultValue
  *
  * @return array
  */
 public function generateWorldCountriesSelect($defaultValue = '')
 {
     return $this->formsHelpers->choicesGenerator('country', Country::worldCountries(), $defaultValue);
 }