id; } /** * @return string */ public function getLogin() { return $this->login; } /** * @param string $login */ public function setLogin($login) { $this->login = $login; } /** * @return string */ public function getEmail() { return $this->email; } /** * @param string $email */ public function setEmail($email) { $this->email = $email; } /** * @return string */ public function getPassword() { return $this->password; } /** * * @param string $password */ public function setPassword($password) { $this->password = $password; } /** * @return string */ public function getNonce() { return $this->nonce; } /** * @param string $nonce */ public function setNonce($nonce) { $this->nonce = $nonce; } /** * @return boolean */ public function isSaltedPassword() { return $this->saltedPassword; } /** * @param boolean $saltedPassword */ public function setSaltedPassword($saltedPassword) { $this->saltedPassword = (Boolean) $saltedPassword; } /** * @return string */ public function getFirstName() { return $this->firstName; } /** * @param string $firstName */ public function setFirstName($firstName) { $this->firstName = $firstName; } /** * @return string */ public function getLastName() { return $this->lastName; } /** * * @param string $lastName */ public function setLastName($lastName) { $this->lastName = $lastName; } /** * @return string */ public function getGender() { return $this->gender; } /** * @param string $gender * * @throws InvalidArgumentException */ public function setGender($gender) { if (null !== $gender && !in_array($gender, array( self::GENDER_MISS, self::GENDER_MR, self::GENDER_MRS ))) { throw new InvalidArgumentException(sprintf("Invalid gender %s.", $gender)); } $this->gender = $gender; } /** * @return string */ public function getAddress() { return $this->address; } /** * @param string $address */ public function setAddress($address) { $this->address = $address; } /** * @return string */ public function getCity() { return $this->city; } /** * @param string $city */ public function setCity($city) { $this->city = $city; } /** * @return string */ public function getCountry() { return $this->country; } /** * @param string $country */ public function setCountry($country) { $this->country = $country; } /** * @return string */ public function getZipCode() { return $this->zipCode; } /** * @param string $zipCode */ public function setZipCode($zipCode) { $this->zipCode = $zipCode; } /** * @return integer */ public function getGeonameId() { return $this->geonameId; } /** * @param integer $geonameId */ public function setGeonameId($geonameId) { if (null !== $geonameId && $geonameId < 1) { throw new InvalidArgumentException(sprintf('Invalid geonameid %s.', $geonameId)); } $this->geonameId = $geonameId; } /** * @return string */ public function getLocale() { return $this->locale; } /** * @param string $locale * * @throws InvalidArgumentException */ public function setLocale($locale) { if (null !== $locale && !array_key_exists($locale, Application::getAvailableLanguages())) { throw new InvalidArgumentException(sprintf('Invalid locale %s.', $locale)); } $this->locale = $locale; } /** * @return string */ public function getTimezone() { return $this->timezone; } /** * @param string $timezone */ public function setTimezone($timezone) { $this->timezone = $timezone; } /** * @return string */ public function getJob() { return $this->job; } /** * @param string $job */ public function setJob($job) { $this->job = $job; } /** * @return string */ public function getActivity() { return $this->activity; } /** * @param string $activity */ public function setActivity($activity) { $this->activity = $activity; } /** * @return string */ public function getCompany() { return $this->company; } /** * @param string $company */ public function setCompany($company) { $this->company = $company; } /** * @return string */ public function getPhone() { return $this->phone; } /** * @param string $phone */ public function setPhone($phone) { $this->phone = $phone; } /** * @return string */ public function getFax() { return $this->fax; } /** * @param string $fax */ public function setFax($fax) { $this->fax = $fax; } /** * @return boolean */ public function isAdmin() { return $this->admin; } /** * @param boolean $admin */ public function setAdmin($admin) { $this->admin = (Boolean) $admin; } /** * @return boolean */ public function isGuest() { return $this->guest; } /** * @param boolean $guest */ public function setGuest($guest) { $this->guest = (Boolean) $guest; } /** * @return boolean */ public function hasMailNotificationsActivated() { return $this->mailNotificationsActivated; } /** * @param boolean $mailNotifications */ public function setMailNotificationsActivated($mailNotifications) { $this->mailNotificationsActivated = (Boolean) $mailNotifications; } /** * @return boolean */ public function hasRequestNotificationsActivated() { return $this->requestNotificationsActivated; } /** * @param boolean $requestNotifications */ public function setRequestNotificationsActivated($requestNotifications) { $this->requestNotificationsActivated = (Boolean) $requestNotifications; } /** * @return boolean */ public function hasLdapCreated() { return $this->ldapCreated; } /** * @param boolean $ldapCreated */ public function setLdapCreated($ldapCreated) { $this->ldapCreated = (Boolean) $ldapCreated; } /** * @return integer */ public function getModelOf() { return $this->modelOf; } /** * @param integer $modelOf */ public function setModelOf($modelOf) { $this->modelOf = $modelOf; } /** * @return string */ public function getLastModel() { return $this->lastModel; } /** * @param string $lastModel */ public function setLastModel($lastModel) { $this->lastModel = $lastModel; } /** * @return string */ public function getPushList() { return $this->pushList; } /** * @param string $pushList */ public function setPushList($pushList) { $this->pushList = $pushList; } /** * @return boolean */ public function canChangeProfil() { return $this->canChangeProfil; } /** * @param boolean $canChangeProfil */ public function setCanChangeProfil($canChangeProfil) { $this->canChangeProfil = (Boolean) $canChangeProfil; } /** * @return boolean */ public function canChangeFtpProfil() { return $this->canChangeFtpProfil; } /** * @param boolean $canChangeFtpProfil */ public function setCanChangeFtpProfil($canChangeFtpProfil) { $this->canChangeFtpProfil = (Boolean) $canChangeFtpProfil; } /** * @return \DateTime */ public function getLastConnection() { return $this->lastConnection; } /** * @param \DateTime $lastConnection */ public function setLastConnection(\DateTime $lastConnection) { $this->lastConnection = $lastConnection; } /** * @return boolean */ public function isMailLocked() { return $this->mailLocked; } /** * @param boolean $mailLocked */ public function setMailLocked($mailLocked) { $this->mailLocked = (Boolean) $mailLocked; } /** * @return boolean */ public function isDeleted() { return $this->deleted; } /** * @param boolean $deleted * * @return User */ public function setDeleted($deleted) { $this->deleted = (Boolean) $deleted; return $this; } /** * @return \DateTime */ public function getCreated() { return $this->created; } /** * @return \DateTime */ public function getUpdated() { return $this->updated; } /** * @param \Datetime $created */ public function setCreated(\Datetime $created) { $this->created = $created; } /** * @param \Datetime $updated */ public function setUpdated(\Datetime $updated) { $this->updated = $updated; } /** * @param Application $app * * @return \ACL */ public function ACL(Application $app) { if (!$this->acl instanceof \ACL) { $this->acl = new \ACL($this, $app); } return $this->acl; } /** * @return boolean */ public function isTemplate() { return null !== $this->modelOf; } /** * @return boolean */ public function isSpecial() { return in_array($this->login, array('invite', 'autoregister')); } /** * @return string */ public function getDisplayName() { if ($this->isTemplate()) { return sprintf(_('modele %s'), $this->getLogin()); } if (trim($this->lastName) !== '' || trim($this->firstName) !== '') { return $this->firstName . ('' !== $this->firstName && '' !== $this->lastName ? ' ' : '') . $this->lastName; } if (trim($this->email) !== '') { return $this->email; } return _('Unnamed user'); } }