username!='demo') $this->errorCode=self::ERROR_USERNAME_INVALID; else if($this->password!='demo') $this->errorCode=self::ERROR_PASSWORD_INVALID; else $this->errorCode=self::ERROR_NONE; return !$this->errorCode; } }