/** * Handle get action * Get appropriate thread * @return Response */ protected function get() { $parameter = $this->getRequest()->get('slug'); if ($parameter === null) { throw new Http\BadRequest('Missing username parameter'); } $criteria = array('slug' => $parameter); /** @var User */ $user = $this->getEntityManager()->getRepository('Entity\\User')->findOneBy($criteria); if (!$user instanceof Entity\user) { throw new Http\NotFound('The requested user could not be found.'); } $result = array('id' => $user->getId(), 'username' => $user->getUserName(), 'slug' => $user->getSlug(), 'email' => $user->getEmail(), 'first_name' => $user->getFirsName(), 'last_name' => $user->getLastName(), 'country' => $user->getCountry(), 'zip_code' => $user->getZipCode(), 'gender' => $user->getGender(), 'about' => $user->getAbout(), 'language' => $user->getLanguage(), 'last_update' => $user->lastUpdate(), 'registered' => $user->registeredDate(), 'birthday' => $user->birthdayDate(), 'notification_max_time' => $user->notificationMaxTime(), 'notification_min_time' => $user->notificationMinTime()); $fieldSelection = $this->getFieldsSelection(); $properResult = $this->properResult($fieldSelection, $result); return new Response(\Statme\Utils::json_encode($properResult), self::GET_OK, self::JSON_HEADERS); }
public function __construct() { $this->subscriptions = new ArrayCollection(); $this->alphaId = \Statme\Utils::alphaId(); }
public function __construct() { $this->alphaId = \Statme\Utils::alphaId(); }