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 0490db4..f4d95f2 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 f23ae76..5a03d60 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 24d21b6..b483968 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 0ae0a1e..f7616b3 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 8922c42..eb2f6f3 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 7df6e91..3fdb10a 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 d81e4b2..a089ae6 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 252d05d..9909c3d 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 6e0ef56..77426cc 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 7ea4b61..d1a3266 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 0b66c12..6c2b998 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 68a4122..e708b2c 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 b285902..6543d45 100644 (file)
  */
 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 9d65fa8..a0d8003 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 661b38f..657fbd0 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 1960794..25cc4ba 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 9dcb47d..f6013da 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 2f738b5..f92356b 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 f907e6f..cb4562e 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 c42c53e..820a27a 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 fd4817f..09abcca 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 4e81d30..87e89f2 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 62ccd3f..92612ba 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");