More stubs added, code "made" generic:
[shipsimu.git] / inc / classes / main / user / class_BaseUser.php
index e7e4541e70623d0dcaf99a6150777ece46fa41b7..e9ce25c3f45061a9b66c7361fc2372ab5960d8ee 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class BaseUser extends BaseFrameworkSystem {
-       /**
-        * Instance of the database result
-        */
-       private $resultInstance = null;
-
        /**
         * Username of current user
         */
@@ -71,7 +66,7 @@ class BaseUser extends BaseFrameworkSystem {
 
                // Do we have an entry?
                if (!$this->getResultInstance()->valid()) {
-                       throw new InvalidDatabaseResultException(array($this, $this->resultInstance), DatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
+                       throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), DatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
                } // END - if
 
                // Get next entry
@@ -122,15 +117,6 @@ class BaseUser extends BaseFrameworkSystem {
                return $this->email;
        }
 
-       /**
-        * Getter for database result instance
-        *
-        * @return      $resultInstance         An instance of a database result class
-        */
-       protected final function getResultInstance () {
-               return $this->resultInstance;
-       }
-
        /**
         * Determines wether the username exists or not
         *
@@ -153,7 +139,7 @@ class BaseUser extends BaseFrameworkSystem {
                        $criteriaInstance->setLimit(1);
 
                        // Get a search result
-                       $this->resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+                       $this->setResultInstance($wrapperInstance->doSelectByCriteria($criteriaInstance));
                } else {
                        // Rewind it
                        $this->getResultInstance()->rewind();
@@ -191,7 +177,7 @@ class BaseUser extends BaseFrameworkSystem {
                        $criteriaInstance->setLimit(1);
 
                        // Get a search resultInstance
-                       $this->resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+                       $this->setResultInstance($wrapperInstance->doSelectByCriteria($criteriaInstance));
                } else {
                        // Rewind it
                        $this->getResultInstance()->rewind();
@@ -229,7 +215,7 @@ class BaseUser extends BaseFrameworkSystem {
                $criteriaInstance->setLimit(1);
 
                // Get a search resultInstance
-               $this->resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
+               $this->setResultInstance($wrapperInstance->doSelectByCriteria($criteriaInstance));
 
                // Search for it
                if ($this->getResultInstance()->next()) {