*
* @return $passHash User's password hash from database result
*/
- public function getPasswordHash () {
+ public final function getPasswordHash () {
// Default is missing password hash
$passHash = null;
* @return $fieldValue Field value from the user
* @todo Do we need to secure this here against missing results?
*/
- public function getField ($fieldName) {
+ public final function getField ($fieldName) {
// Default field value
$fieldValue = null;
// Return it
return $fieldValue;
}
+
+ /**
+ * Getter for primary key value
+ *
+ * @return $primaryValue Value of the primary key based on database type
+ */
+ public final function getPrimaryKey () {
+ // Get a user database wrapper
+ $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper_class');
+
+ // Get the primary key back from the wrapper
+ $primaryKey = $wrapperInstance->getPrimaryKeyValue();
+
+ // Get that field
+ $primaryValue = $this->getField($primaryKey);
+
+ // Return the value
+ return $primaryValue;
+ }
}
// [EOF]