Generic methods created from non-generic implementation:
[shipsimu.git] / inc / classes / main / user / class_BaseUser.php
index cee4fc31d628d8b2c00cb39414c7554f95a1e8a7..715544eb65bb635dd29c71dcd09a61288ed3c561 100644 (file)
@@ -47,38 +47,6 @@ class BaseUser extends BaseFrameworkSystem {
                $this->removeSystemArray();
        }
 
-       /**
-        * "Getter" for databse entry
-        *
-        * @return      $entry  An array with database entries
-        * @throws      NullPointerException    If the database result is not found
-        * @throws      InvalidDatabaseResultException  If the database result is invalid
-        */
-       private function getDatabaseEntry () {
-               // Is there an instance?
-               if (is_null($this->getResultInstance())) {
-                       // Throw new exception
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
-               } // END - if
-
-               // Rewind it
-               $this->getResultInstance()->rewind();
-
-               // Do we have an entry?
-               if (!$this->getResultInstance()->valid()) {
-                       throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), DatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
-               } // END - if
-
-               // Get next entry
-               $this->getResultInstance()->next();
-
-               // Fetch it
-               $entry = $this->getResultInstance()->current();
-
-               // And return it
-               return $entry;
-       }
-
        /**
         * Setter for username
         *
@@ -256,45 +224,12 @@ class BaseUser extends BaseFrameworkSystem {
                if (isset($entry['pass_hash'])) {
                        // Get it
                        $passHash = $entry['pass_hash'];
-               }
+               } // END - if
 
                // And return the hash
                return $passHash;
        }
 
-       /**
-        * Getter for field name
-        *
-        * @param       $fieldName              Field name which we shall get
-        * @return      $fieldValue             Field value from the user
-        * @throws      NullPointerException    If the result instance is null
-        */
-       public final function getField ($fieldName) {
-               // Default field value
-               $fieldValue = null;
-
-               // Get result instance
-               $resultInstance = $this->getResultInstance();
-
-               // Is this instance null?
-               if (is_null($resultInstance)) {
-                       // Then the user instance is no longer valid (expired cookies?)
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
-               } // END - if
-
-               // Get current array
-               $fieldArray = $resultInstance->current();
-
-               // Does the field exist?
-               if (isset($fieldArray[$fieldName])) {
-                       // Get it
-                       $fieldValue = $fieldArray[$fieldName];
-               } // END - if
-
-               // Return it
-               return $fieldValue;
-       }
-
        /**
         * Getter for primary key value
         *