]> git.mxchange.org Git - shipsimu.git/commitdiff
Fake class names added, insertDataSet() stub added, dataset criteria added
authorRoland Häder <roland@mxchange.org>
Sun, 8 Jun 2008 19:43:37 +0000 (19:43 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 8 Jun 2008 19:43:37 +0000 (19:43 +0000)
27 files changed:
.gitattributes
application/selector/class_ApplicationSelector.php
application/ship-simu/main/class_Merchant.php
application/ship-simu/main/companies/class_ShippingCompany.php
application/ship-simu/main/constructions/harbors/class_Harbor.php
application/ship-simu/main/constructions/yards/class_Shipyard.php
application/ship-simu/main/personell/class_SimulatorPersonell.php
application/ship-simu/main/registration/class_ShipSimuRegistration.php
application/ship-simu/main/ships/class_BaseShip.php
inc/classes/interfaces/criteria/extended/class_LocalCriteria.php [deleted file]
inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php [new file with mode: 0644]
inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php [new file with mode: 0644]
inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php
inc/classes/interfaces/database/frontend/class_DatabaseFrontendInterface.php
inc/classes/main/cache/class_MemoryCache.php
inc/classes/main/class_FrameworkArrayObject.php
inc/classes/main/criteria/class_DataSetCriteria.php [new file with mode: 0644]
inc/classes/main/criteria/class_SearchCriteria.php
inc/classes/main/database/class_
inc/classes/main/database/databases/class_LocalFileDatabase.php
inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php
inc/classes/main/extended/class_ObjectLimits.php
inc/classes/main/language/class_LanguageSystem.php
inc/classes/main/request/class_HttpRequest.php
inc/classes/main/template/class_TemplateEngine.php
inc/classes/middleware/database/class_DatabaseConnection.php
inc/config.php

index 0490db4c047590ebe2c23859f56b2ccf37ecc433..f4d95f2842f72d493671077d77a552e2b586c9d0 100644 (file)
@@ -236,7 +236,8 @@ inc/classes/interfaces/controller/class_Controller.php -text
 inc/classes/interfaces/criteria/.htaccess -text
 inc/classes/interfaces/criteria/class_Criteria.php -text
 inc/classes/interfaces/criteria/extended/.htaccess -text
-inc/classes/interfaces/criteria/extended/class_LocalCriteria.php -text
+inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php -text
+inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php -text
 inc/classes/interfaces/database/.htaccess -text
 inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php -text
 inc/classes/interfaces/database/frontend/.htaccess -text
@@ -303,6 +304,7 @@ inc/classes/main/controller/default/class_WebDefaultNewsController.php -text
 inc/classes/main/controller/form/.htaccess -text
 inc/classes/main/controller/form/class_WebDoFormController.php -text
 inc/classes/main/criteria/.htaccess -text
+inc/classes/main/criteria/class_DataSetCriteria.php -text
 inc/classes/main/criteria/class_SearchCriteria.php -text
 inc/classes/main/crypto/.htaccess -text
 inc/classes/main/crypto/class_CryptoHelper.php -text
index f23ae762621856fe7cbd2ed10f430e91085dccad..5a03d60b023d954663d059957bce966089948c5f 100644 (file)
@@ -101,7 +101,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
         * @return      void
         */
        private function initializeAppsList () {
-               $this->foundApps = new FrameworkArrayObject();
+               $this->foundApps = new FrameworkArrayObject("FakedFoundApplications");
        }
 
        /**
@@ -110,7 +110,7 @@ class ApplicationSelector extends BaseFrameworkSystem {
         * @return      void
         */
        private function initializeTemplatesList () {
-               $this->loadedTemplates = new FrameworkArrayObject();
+               $this->loadedTemplates = new FrameworkArrayObject("FakedLoadedTemplates");
        }
 
        /**
index 24d21b6a093b9f24dd27f3c78d64b186ecacc535..b483968a975f36d8d14ab13ddabfc3f8312c68a8 100644 (file)
@@ -84,7 +84,7 @@ class Merchant extends BaseFrameworkSystem {
                        __LINE__,
                        $this->getMerchantName()
                ));
-               $this->priceList = new FrameworkArrayObject();
+               $this->priceList = new FrameworkArrayObject("FakedPriceList");
        }
 
        // Setter for merchant name
index 0ae0a1e5a9bcd8ce0f2dd04fe0b3f60f01499bb7..f7616b32a8545dcce9eaa53896ab2fa34b6e68a7 100644 (file)
@@ -128,7 +128,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
                        __LINE__,
                        $this->getCompanyName()
                ));
-               $this->employeeList = new FrameworkArrayObject();
+               $this->employeeList = new FrameworkArrayObject("FakedEmployeeList");
        }
 
        // Werftenliste erstellen
@@ -138,7 +138,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
                        __LINE__,
                        $this->getCompanyName()
                ));
-               $this->shipyardList = new FrameworkArrayObject();
+               $this->shipyardList = new FrameworkArrayObject("FakedShipyardList");
        }
 
        // Auftragsliste erstellen
@@ -148,7 +148,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
                        __LINE__,
                        $this->getCompanyName()
                ));
-               $this->contractList = new FrameworkArrayObject();
+               $this->contractList = new FrameworkArrayObject("FakedContractList");
        }
 
        // Setter-Methode fuer Firmennamen
index 8922c42a936e1c54a0f70fcee17d0375c4567317..eb2f6f37c555528b7bc39099291a42c73ecaf1da 100644 (file)
@@ -76,7 +76,7 @@ class Harbor extends BaseConstruction {
                if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Werft-Liste wird f&uuml;r den Hafen <strong>%s</strong> erstellt.<br />\n",
                        $this->getHarborName()
                ));
-               $this->shipyardList = new FrameworkArrayObject();
+               $this->shipyardList = new FrameworkArrayObject("FakedShipyardList");
        }
 
        // Setter fuer Hafennamen
index 7df6e91eaa9377c903c6f5f921c86f58bc4f95a6..3fdb10a4e93436c238889900a587057149640ec3 100644 (file)
@@ -121,7 +121,7 @@ class Shipyard extends BaseConstruction {
                        __LINE__,
                        $this->getShipyardName()
                ));
-               $this->staffList = new FrameworkArrayObject();
+               $this->staffList = new FrameworkArrayObject("FakedStaffList");
        }
 
        // Create ship type list
@@ -131,7 +131,7 @@ class Shipyard extends BaseConstruction {
                        __LINE__,
                        $this->getShipyardName()
                ));
-               $this->shipTypeList = new FrameworkArrayObject();
+               $this->shipTypeList = new FrameworkArrayObject("FakedShipTypeList");
        }
 
        // Setter-Methode fuer Werft-Name
index d81e4b2d8ba6c256b11970b9d2e8d8cd010ab5d4..a089ae695916177dbe2a9931844f7f4932ec6453 100644 (file)
@@ -198,7 +198,7 @@ class SimulatorPersonell extends BasePersonell {
                                __CLASS__,
                                __LINE__
                        ));
-                       $this->personellList = new FrameworkArrayObject();
+                       $this->personellList = new FrameworkArrayObject("FakedPersonellList");
                } else {
                        throw new PersonellListAlreadyCreatedException($this, self::EXCEPTION_DIMENSION_ARRAY_INVALID);
                }
@@ -270,7 +270,7 @@ class SimulatorPersonell extends BasePersonell {
                $this->setCacheCond($serialized);
 
                // Create cached list
-               $this->setAllCacheList(new FrameworkArrayObject());
+               $this->setAllCacheList(new FrameworkArrayObject("FakedCacheList"));
 
                // Search all unemployed personells
                for ($idx = $this->personellList->getIterator(); $idx->valid(); $idx->next()) {
index 252d05df20457e27e37311af7fe3ff711db0c5ea..9909c3d6d128af731c9771b8940013cdd2b1017e 100644 (file)
@@ -98,7 +98,11 @@ class ShipSimuRegistration extends BaseRegistration {
         * @return      void
         */
        public function registerNewUser () {
-               $this->partialStub();
+               // Get a user database wrapper
+               $wrapperInstance = ObjectFactory::createObjectByConfiguredName('user_db_wrapper');
+
+               // Use this instance to insert the whole registration instance
+               $wrapperInstance->insertRegistrationObject($this);
        }
 
        /**
index 6e0ef56d26b545a3a71e5cc2794c65f4e5027dd2..77426cc5d0c66ee2436ff955eee48f005d546745 100644 (file)
@@ -55,7 +55,7 @@ class BaseShip extends BaseSimulator {
 
        // Array-Objekt anlegen
        private function createStructuresArray () {
-               $this->structures = new FrameworkArrayObject();
+               $this->structures = new FrameworkArrayObject("FakedShipStructures");
        }
 
        // Schiffsteil generieren (kann alles sein)
diff --git a/inc/classes/interfaces/criteria/extended/class_LocalCriteria.php b/inc/classes/interfaces/criteria/extended/class_LocalCriteria.php
deleted file mode 100644 (file)
index 2ac9efd..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * An interface for local criterias
- *
- * @author             Roland Haeder <webmaster@mxchange.org>
- * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
- * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-interface LocalCriteria extends Criteria {
-}
-
-//
-?>
diff --git a/inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php b/inc/classes/interfaces/criteria/extended/class_LocalSearchCriteria.php
new file mode 100644 (file)
index 0000000..2ac9efd
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for local criterias
+ *
+ * @author             Roland Haeder <webmaster@mxchange.org>
+ * @version            0.0.0
+ * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface LocalCriteria extends Criteria {
+}
+
+//
+?>
diff --git a/inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php b/inc/classes/interfaces/criteria/extended/class_StoreableCriteria.php
new file mode 100644 (file)
index 0000000..8af7c67
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * An interface for storeable data sets
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+interface StoreableCriteria extends Criteria {
+}
+
+// [EOF]
+?>
index 7ea4b6149130a4c4337b72637da318ec46e8ae8f..d1a3266f72c0138b5cb06e14a1ba4fd057d13ee3 100644 (file)
@@ -30,8 +30,9 @@ interface FrameworkDatabaseInterface extends FrameworkInterface {
         * @param               $object An instance to the object we want to save
         * @return      void
         * @see         limitObject(ObjectLimits)       limitObject
+        * @deprecated
         */
-       function saveObject ($object);
+       function saveObject (FrameworkInterface $object);
 
        /**
         * Analyses if a unique ID has already been used or not. This method does
@@ -62,6 +63,7 @@ interface FrameworkDatabaseInterface extends FrameworkInterface {
         * @throws      NoObjectException               If $dbInstance is not an object
         * @throws      MissingMethodException  If the required method
         *                                                              isUniqueIdUsed() was not found
+        * @deprecated
         */
        function getObjectFromCachedData ($idNumber);
 }
index 0b66c124ef0ccb7f6a3688f696e0122779c07d89..6c2b998ec46aaceb5ac765d6ab73a295991be2eb 100644 (file)
@@ -34,6 +34,7 @@ interface DatabaseFrontendInterface extends FrameworkDatabaseInterface {
         *
         * @return      Object  The fully re-created object or instance to
         *                                      ObjectContainer
+        * @deprecated
         */
        function loadObject ();
 
@@ -56,6 +57,14 @@ interface DatabaseFrontendInterface extends FrameworkDatabaseInterface {
         * @throws      SqlException                                    If an SQL error occurs
         */
        function querySelect ($resultType, $tableName, Criteria $criteriaInstance);
+
+       /**
+        * "Inserts" a data set instance into a local file database folder
+        *
+        * @param       $dataSetInstance        A storeable data set
+        * @return      void
+        */
+       function insertDataSet (StoreableCriteria $dataSetInstance);
 }
 
 // [EOF]
index 68a4122decd67a39273bca78cffa7b7958457a9c..e708b2c0200018b75982940edff210321e2b44dc 100644 (file)
@@ -70,7 +70,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
         */
        protected function initCache () {
                // Now create the "data cache"
-               $this->dataCache = new FrameworkArrayObject();
+               $this->dataCache = new FrameworkArrayObject("FakedDataCache");
        }
 
        /**
index b2859025df9a9ad928a49538f8b436c2ae8d9038..6543d45f09c36863f4adba1351c15b0f16a6f977 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 class FrameworkArrayObject extends ArrayObject {
+       /**
+        * Real class name
+        */
+       private $realClass = "";
+
+       /**
+        * Public constructor for setting real class name
+        *
+        * @param       $className      Real class name
+        * @return      void
+        */
+       public function __construct ($className) {
+               $this->realClass = (string) $className;
+       }
+
        /**
         * Get real class' name back
         *
         * @return      $realClass      The class' real name
         */
        public function __toString () {
-               return get_class($this);
+               return $this->realClass;
        }
 }
 
diff --git a/inc/classes/main/criteria/class_DataSetCriteria.php b/inc/classes/main/criteria/class_DataSetCriteria.php
new file mode 100644 (file)
index 0000000..d16f039
--- /dev/null
@@ -0,0 +1,72 @@
+<?php
+/**
+ * A set of data storeable in databases
+ *
+ * @see                        DatabaseFrontendInterface - An interface for database frontends (front-end to the application)
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class DataSetCriteria extends BaseFrameworkSystem implements StoreableCriteria {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct() {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+
+               // Set part description
+               $this->setObjectDescription("Storeable data set for databases");
+
+               // Create unique ID number
+               $this->createUniqueID();
+
+               // Clean up a little
+               $this->removeNumberFormaters();
+               $this->removeSystemArray();
+       }
+
+       /**
+        * Creates an instance of this criteria
+        *
+        * @return $criteriaInstance    An instance of this criteria
+        */
+       public final static function createDataSetCriteria () {
+               // Get a new instance
+               $criteriaInstance = new DataSetCriteria();
+
+               // Return the instance
+               return $criteriaInstance;
+       }
+
+       /**
+        * Add extra criteria
+        *
+        * @param       $criteriaKey    Criteria key
+        * @param       $criteriaValue  Criteria value
+        * @return      void
+        */
+       public function addCriteria ($criteriaKey, $criteriaValue) {
+               die("STUB!");
+       }
+}
+
+// [EOF]
+?>
index 9d65fa8a3d70ac36cfb9d90d0799ade83ab99855..a0d8003edbedf1398ccfaa534b322cc15a9d8b9e 100644 (file)
@@ -23,7 +23,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-class SearchCriteria extends BaseFrameworkSystem implements LocalCriteria {
+class SearchCriteria extends BaseFrameworkSystem implements LocalSearchCriteria {
        /**
         * Criteria to handle
         */
index 661b38fcf609b2ae50c1081802ebafa7158135e2..657fbd0a4295337bdca8f976d6bdc8e915402cb6 100644 (file)
@@ -28,9 +28,9 @@ class  extends BaseDatabaseFrontend {
         *
         * @return      void
         */
-       protected function __construct($class) {
+       protected function __construct($class = __CLASS__) {
                // Call parent constructor
-               parent::constructor(__CLASS__);
+               parent::__construct($class);
 
                // Set part description
                $this->setObjectDescription("");
index 1960794377b30c5dd218a16a5f14dfe3470631ee..25cc4ba6d52887b51f600b1b5280796fc61f689a 100644 (file)
@@ -151,25 +151,10 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         * Saves a given object to the local file system by serializing and
         * transparently compressing it
         *
-        * @param               $object                         The object we shall save to the local file system
+        * @param       $object                                 The object we shall save to the local file system
         * @return      void
-        * @throws      NullPointerException    If the object instance is null
-        * @throws      NoObjectException               If the parameter $object is not
-        *                                                              an object
         */
-       public final function saveObject ($object) {
-               // Some tests on the parameter...
-               if (is_null($object)) {
-                       // Is null, throw exception
-                       throw new NullPointerException($object, self::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_object($object)) {
-                       // Is not an object, throw exception
-                       throw new NoObjectException($object, self::EXCEPTION_IS_NO_OBJECT);
-               } elseif (!method_exists($object, '__toString')) {
-                       // A highly required method was not found... :-(
-                       throw new MissingMethodException(array($object, '__toString'), self::EXCEPTION_MISSING_METHOD);
-               }
-
+       public final function saveObject (FrameworkInterface $object) {
                // Get a string containing the serialized object. We cannot exchange
                // $this and $object here because $object does not need to worry
                // about it's limitations... ;-)
@@ -186,14 +171,14 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
        /**
         * Get a serialized string from the given object
         *
-        * @param               $object         The object we want to serialize and transparently
-        *                                              compress
-        * @return      $serialized     A string containing the serialzed/compressed object
+        * @param       $object                 The object we want to serialize and transparently
+        *                                                      compress
+        * @return      $serialized             A string containing the serialzed/compressed object
         * @see         ObjectLimits    An object holding limition information
         * @see         SerializationContainer  A special container class for e.g.
-        *                                                              attributes from limited objects
+        *                                                                      attributes from limited objects
         */
-       private function serializeObject ($object) {
+       private function serializeObject (FrameworkInterface $object) {
                // If there is no limiter instance we serialize the whole object
                // otherwise only in the limiter object (ObjectLimits) specified
                // attributes summarized in a special container class
@@ -218,13 +203,13 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
         * Analyses if a unique ID has already been used or not by search in the
         * local database folder.
         *
-        * @param               $uniqueID               A unique ID number which shall be checked
-        *                                              before it will be used
-        * @param               $inConstructor  If we got called in a de/con-structor or
-        *                                              from somewhere else
+        * @param       $uniqueID               A unique ID number which shall be checked
+        *                                                      before it will be used
+        * @param       $inConstructor  If we got called in a de/con-structor or
+        *                                                      from somewhere else
         * @return      $isUnused               true    = The unique ID was not found in the database,
-        *                                              false = It is already in use by an other object
-        * @throws      NoArrayCreatedException If explode() fails to create an array
+        *                                                      false = It is already in use by an other object
+        * @throws      NoArrayCreatedException         If explode() fails to create an array
         * @throws      InvalidArrayCountException      If the array contains less or
         *                                                                      more than two elements
         */
@@ -553,7 +538,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                $resultData = null;
 
                // Is this criteria supported?
-               if (!$criteriaInstance instanceof LocalCriteria) {
+               if (!$criteriaInstance instanceof LocalSearchCriteria) {
                        // Not supported by this database layer
                        throw new UnsupportedCriteriaException(array($this, $criteriaInstance), self::EXCEPTION_REQUIRED_INTERFACE_MISSING);
                }
@@ -600,6 +585,35 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                // Return the gathered result
                return $resultData;
        }
+
+       /**
+        * "Inserts" a data set instance into a local file database folder
+        *
+        * @param       $dataSetInstance        A storeable data set
+        * @return      void
+        */
+       public function insertDataSet (StoreableCriteria $dataSetInstance) {
+               // Create full path name
+               $fqfn = sprintf("%s%s/%s.%s",
+                       $this->getSavePath(),
+                       $dataSetInstance->getTableName(),
+                       $dataSetInstance->getCombinedUniqueKey(),
+                       $this->getFileExtension()
+               );
+               die($fqfn);
+
+               // Try to save the request away
+               try {
+                       // Get a file pointer instance
+
+                       // Reset last error message and exception
+                       $this->resetLastError();
+               } catch (FrameworkException $e) {
+                       // Catch all exceptions and store them in last error
+                       $this->lastException = $e;
+                       $this->lastError = $e->getMessage();
+               }
+       }
 }
 
 // [EOF]
index 9dcb47da0b5c9a678d6d25dfd2b2f872aceb4d6b..f6013da0f6b6f687d9ed515faddc39f62aab4cdb 100644 (file)
@@ -123,6 +123,27 @@ class UserDatabaseWrapper extends BaseDatabaseWrapper {
                // And return the instance
                return $resultInstance;
        }
+
+       /**
+        * Handles inserting the registration data from a registration instance into the database
+        *
+        * @param       $registrationInstance   An instance of a registration class
+        * @return      void
+        */
+       public function insertRegistrationObject (UserRegister $registrationInstance) {
+               // Get the request instance which we use for saving
+               $requestInstance = $registrationInstance->getRequestInstance();
+
+               // Generate a data set for the request
+               $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria');
+               $dataSetInstance->setTableName(self::DB_TABLE_USER);
+
+               // Add all needed request elements to the data set
+               $requestInstance->debugInstance();
+
+               // "Insert" this request instance completely into the database
+               $this->getDatabaseInstance()->insertDataSet($dataSetInstance);
+       }
 }
 
 // [EOF]
index 2f738b56160f3423a52ce5b1bac2dad9446dfc80..f92356b25ced487148f6fa59de51afac768eb160 100644 (file)
@@ -93,7 +93,7 @@ class ObjectLimits extends BaseFrameworkSystem {
                // Auto-initialization
                if (is_null($this->limitArray)) {
                        // Initialize this array
-                       $this->limitArray = new FrameworkArrayObject();
+                       $this->limitArray = new FrameworkArrayObject("FakedLimitArray");
                }
 
                // Add the object's name to it
@@ -110,7 +110,7 @@ class ObjectLimits extends BaseFrameworkSystem {
                // Auto-initialization
                if (is_null($this->limitArray)) {
                        // Initialize this array
-                       $this->limitArray = new FrameworkArrayObject();
+                       $this->limitArray = new FrameworkArrayObject("FakedLimitArray");
                }
 
                // Add the direct string to ArrayObject
index f907e6ff409da37f6e3f857dbf77b2cb59f809ee..cb4562e7118dd4c5a485ef74ba7802d119232b1c 100644 (file)
@@ -150,7 +150,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage {
         * @return      void
         */
        public function initLanguageStrings () {
-               $this->langStrings = new FrameworkArrayObject();
+               $this->langStrings = new FrameworkArrayObject("FakedLanguageStrings");
        }
 
        /**
index c42c53e7e368eaa83254a088d7d451e9cb770703..820a27ac1a048edfe5db36bfa50a3270bcfc39b6 100644 (file)
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class HttpRequest extends BaseFrameworkSystem implements Requestable {
+class HttpRequest extends BaseFrameworkSystem implements Requestable, Iterateable {
        /**
         * Array for the request data
         */
index fd4817ffbe8040f4fb65de0f985423d58bdb89ac..09abcca891c76e1fba4964a86be2418d1e91bef5 100644 (file)
@@ -290,7 +290,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate
         * @return      void
         */
        public final function initVariableStack () {
-               $this->varStack = new FrameworkArrayObject();
+               $this->varStack = new FrameworkArrayObject("FakedVariableStack");
        }
 
        /**
index 4e81d30de06c0b6fe7905cb154c538db62f0616e..87e89f2753122d1d8bbc43f057cdab1fc09f536a 100644 (file)
@@ -98,10 +98,10 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Li
        /**
         * Save a whole object or parts of it to the database or local file
         *
-        * @param               $object The object we shall save
+        * @param       $object         The object we shall save
         * @return      void
         */
-       public function saveObject ($object) {
+       public function saveObject (FrameworkInterface $object) {
                // Connect to the database
                $this->dbLayer->connectToDatabase();
 
@@ -113,9 +113,9 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Li
         * Set a limitation for the saving process. This shall be done before
         * saveObject() is called else saveObject() shall save the whole object.
         *
-        * @param               $limitInstance  An instance of ObjectLimits which contains
-        *                                              elements we shall exclusivly include in
-        *                                              saving process
+        * @param       $limitInstance  An instance of ObjectLimits which contains
+        *                                                      elements we shall exclusivly include in
+        *                                                      saving process
         * @return      void
         */
        public function limitObject (ObjectLimits $limitInstance) {
@@ -199,6 +199,20 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Li
                $exceptionInstance = $this->dbLayer->getLastException();
                return $exceptionInstance;
        }
+
+       /**
+        * "Inserts" a data set instance into a local file database folder
+        *
+        * @param       $dataSetInstance        A storeable data set
+        * @return      void
+        */
+       public function insertDataSet (StoreableCriteria $dataSetInstance) {
+               // Connect to the database
+               $this->dbLayer->connectToDatabase();
+
+               // Ask the database layer
+               $this->dbLayer->insertDataSet($requestInstance);
+       }
 }
 
 // [EOF]
index 62ccd3f54026eb10679bbf65d02d70dbb3923eac..92612ba04cd83b5c88344b8e944688af6730b483 100644 (file)
@@ -153,6 +153,9 @@ $cfg->setConfigEntry('cache_type', "MemoryCache");
 // CFG: SEARCH-CRITERIA
 $cfg->setConfigEntry('search_criteria', "SearchCriteria");
 
+// CFG: DATASET-CRITERIA
+$cfg->setConfigEntry('dataset_criteria', "DataSetCriteria");
+
 // CFG: FILE-IO-HANDLER
 $cfg->setConfigEntry('file_io_handler', "FileIoHandler");