*/
private $userName = "";
+ /**
+ * User id of current user
+ */
+ private $userId = 0;
+
/**
* Email of current user
*/
* @return void
*/
public final function setUserName ($userName) {
- $this->userName = $userName;
+ $this->userName = (string) $userName;
}
/**
- * Setter for email
+ * Getter for username
*
- * @param $email The email to set
+ * @return $userName The username to get
+ */
+ public final function getUserName () {
+ return $this->userName;
+ }
+
+ /**
+ * Setter for user id
+ *
+ * @param $userId The user id to set
* @return void
+ * @todo Find a way of casting here. "(int)" might destroy the user id > 32766
*/
- protected final function setEmail ($email) {
- $this->email = $email;
+ public final function setUserId ($userId) {
+ $this->userId = $userId;
}
/**
- * Getter for username
+ * Getter for user id
*
- * @return $userName The username to get
+ * @return $userId The user id to get
*/
- public final function getUsername () {
- return $this->userName;
+ public final function getUserId () {
+ return $this->userId;
+ }
+
+ /**
+ * Setter for email
+ *
+ * @param $email The email to set
+ * @return void
+ */
+ protected final function setEmail ($email) {
+ $this->email = (string) $email;
}
/**
$criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
// Add the username as a criteria and set limit to one entry
- $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUsername());
+ $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+ $criteriaInstance->setIndexSolution(UserDatabaseWrapper::DB_COLUMN_USERID, array($this, 'setUserId'));
$criteriaInstance->setLimit(1);
// Get a search result
// Add the username as a criteria and set limit to one entry
$criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_EMAIL, $this->getEmail());
+ $criteriaInstance->setIndexSolution(UserDatabaseWrapper::DB_COLUMN_USERID, array($this, 'setUserId'));
$criteriaInstance->setLimit(1);
// Get a search resultInstance
// Add the username as a criteria and set limit to one entry
$criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+ $criteriaInstance->setIndexSolution(UserDatabaseWrapper::DB_COLUMN_USERID, array($this, 'setUserId'));
$criteriaInstance->setLimit(1);
// Get a search resultInstance