Example #1
0
 /**
  * @param int $id
  *
  * @return array
  * @throws \ACP3\Core\Controller\Exception\ResultNotExistsException
  */
 public function execute($id)
 {
     if ($this->userRepository->resultExists($id) === true) {
         $this->setCacheResponseCacheable($this->config->getSettings(Schema::MODULE_NAME)['cache_lifetime']);
         $user = $this->user->getUserInfo($id);
         $user['gender'] = str_replace([1, 2, 3], ['', $this->translator->t('users', 'female'), $this->translator->t('users', 'male')], $user['gender']);
         return ['user' => $user];
     }
     throw new Core\Controller\Exception\ResultNotExistsException();
 }