*/
private $username = "";
+ /**
+ * An instance of a database wrapper
+ */
+ private $userWrapper = null;
+
// Exceptions
const EXCEPTION_USERNAME_NOT_FOUND = 0xd00;
/**
* Getter for username
*
- * @return $userName The username to set
+ * @return $userName The username to get
*/
public final function getUsername () {
return $this->userNane;
}
+
+ /**
+ * Determines wether the username exists or not
+ *
+ * @return $exists Wether the username exists
+ */
+ protected function ifUsernameExists () {
+ // By default the username does exist
+ $exists = true;
+
+ // Try to get a UserDatabaseWrapper object back
+ try {
+ // Get the instance by providing this class
+ $this->userWrapper = UserDatabaseWrapper::createUserDatabaseWrapper($this);
+ } catch (WrapperUserNameNotFoundException $e) {
+ // Does not exist!
+ $exists = false;
+ }
+
+ // Return the status
+ return $exists;
+ }
}
// [EOF]