getProfile() != null); } /** * * @return Profile */ public function getProfile() { return Doctrine::getTable('Profile')->findOneByUserId($this->getId()); } public function getName() { return $this->getFirstName().' '.$this->getLastName(); } public function getTypeName() { if($this->hasProfile()) { if($this->getProfile()->getTypeId() == ProfileType::AGENCY) { return 'Instituce (nabízí práci)'; } else { return 'Zájemce o práci'; } } return 'Admin'; } public function getToken() { return sha1($this->getUsername().self::SALT.$this->password); } }