/** * @return array */ public function jsonSerialize() { $userInArray = array('isconnected' => $this->user->isConnected($this->expired), 'userid' => $this->user->getId(), 'enabled' => $this->user->getEnabled(), 'username' => $this->user->getUserName(), 'lastname' => $this->user->getName() ? $this->user->getName() : $this->user->getUserName(), 'firstname' => $this->user->getNickname(), 'email' => $this->user->getEmail(), 'address' => $this->user->getAddress(), 'cp' => $this->user->getZipCode(), 'city' => $this->user->getCity(), 'country' => $this->user->getCountry(), 'lang_code' => $this->user->getLangCode() instanceof Langue ? $this->user->getLangCode()->getId() : "", 'birthday' => $this->user->getBirthday(), 'global_optin' => $this->user->getGlobalOptIn(), 'site_optin' => $this->user->getSiteOptIn(), 'created_at' => $this->user->getCreatedAt(), 'updated_at' => $this->user->getUpdatedAt(), 'error' => $this->getError()); return json_encode($userInArray); }