/** * returns the user name from person id * @param integer $id * @return User_Model_User */ public function getUser($id) { $userDao = new User_Persist_Dao_User(); $user = $userDao->getByPersonId($id); return $user; }
/** * Try to identify if a user exist based on its unique keys: id, name, email * @return boolean | String Return false if none of the keys identify a user in database. Returns a string with each key identified. */ public function existUser() { $dao = new User_Persist_Dao_User(); $find = ''; if ($this->getUser()->getId()) { if ($dao->get($this->getUser()->getId())) { $find .= 'id|'; } } if ($this->getUser()->getName()) { if ($dao->getByName($this->getUser()->getName(), $this->getUser()->getAppaccount_id())) { $find .= 'name|'; } } if ($this->getUser()->getEmail()) { if ($dao->getByEmail($this->getUser()->getEmail())) { $find .= 'email|'; } } }