Used more DatabaseWrapperFactory as one instance of each is fine.
[core.git] / inc / classes / main / class_BaseFrameworkSystem.php
index d523e639f4ca8af2738eaff56989cb9dbb7c136d..4205170200d1e544d6e3dfe34aa55a21350f6222 100644 (file)
@@ -218,6 +218,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $communicatorInstance = NULL;
 
+       /**
+        * State instance
+        */
+       private $stateInstance = NULL;
+
        /**
         * Thousands separator
         */
@@ -258,6 +263,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $controllerName = '';
 
+       /**
+        * Name of used protocol
+        */
+       private $protocolName = 'invalid';
+
        /**
         * Array with bitmasks and such for pack/unpack methods to support both
         * 32-bit and 64-bit systems
@@ -475,10 +485,13 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Init argument string
                $argsString = '';
 
-               // Is it empty or an array?
-               if (empty($args)) {
+               // Is it NULL, empty or an array?
+               if (is_null($args)) {
                        // No arguments
                        $argsString = 'NULL';
+               } elseif (empty($args)) {
+                       // Empty arguments
+                       $argsString = '(empty)';
                } elseif (is_array($args)) {
                        // Some arguments are there
                        foreach ($args as $arg) {
@@ -1530,6 +1543,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $this->communicatorInstance = $communicatorInstance;
        }
 
+       /**
+        * Setter for state instance
+        *
+        * @param       $stateInstance  A Stateable instance
+        * @return      void
+        */
+       public final function setStateInstance (Stateable $stateInstance) {
+               $this->stateInstance = $stateInstance;
+       }
+
+       /**
+        * Getter for state instance
+        *
+        * @return      $stateInstance  A Stateable instance
+        */
+       public final function getStateInstance () {
+               return $this->stateInstance;
+       }
+
        /**
         * Setter for command name
         *
@@ -1568,6 +1600,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $this->controllerName;
        }
 
+       /**
+        * Getter for protocol name
+        *
+        * @return      $protocolName   Name of used protocol
+        */
+       public final function getProtocolName () {
+               return $this->protocolName;
+       }
+
+       /**
+        * Setter for protocol name
+        *
+        * @param       $protocolName   Name of used protocol
+        * @return      void
+        */
+       protected final function setProtocolName ($protocolName) {
+               $this->protocolName = $protocolName;
+       }
+
        /**
         * Checks whether an object equals this object. You should overwrite this
         * method to implement own equality checks
@@ -2148,7 +2199,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $configEntry = $resultInstance->getUpdateInstance()->getWrapperConfigEntry();
 
                        // Create object instance
-                       $wrapperInstance = ObjectFactory::createObjectByConfiguredName($configEntry);
+                       $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName($configEntry);
 
                        // Yes, then send the whole result to the database layer
                        $wrapperInstance->doUpdateByResult($this->getResultInstance());