Fixed type-hint (still no interface).
[core.git] / inc / classes / main / class_BaseFrameworkSystem.php
index abb48a9327f5a8cc2faebbfb368e93ccceed2c6c..b13875fa7a71d1df7aca2103db2ada88d889d346 100644 (file)
@@ -173,6 +173,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        private $wrapperInstance = NULL;
 
+       /**
+        * An instance of a file I/O pointer class (not handler)
+        */
+       private $pointerInstance = NULL;
+
        /**
         * Thousands separator
         */
@@ -249,6 +254,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        const EXCEPTION_ARRAY_ELEMENTS_MISSING       = 0x02c;
        const EXCEPTION_TEMPLATE_ENGINE_UNSUPPORTED  = 0x02d;
        const EXCEPTION_UNSPPORTED_OPERATION         = 0x02e;
+       const EXCEPTION_FACTORY_REQUIRE_PARAMETER    = 0x02f;
        const EXCEPTION_MISSING_ELEMENT              = 0x030;
        const EXCEPTION_HEADERS_ALREADY_SENT         = 0x031;
        const EXCEPTION_DEFAULT_CONTROLLER_GONE      = 0x032;
@@ -259,7 +265,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        const EXCEPTION_ASSERTION_FAILED             = 0x037;
        const EXCEPTION_FILE_CANNOT_BE_READ          = 0x038;
        const EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED = 0x039;
-       const EXCEPTION_FILTER_CHAIN_INTERCEPTED     = 0x040;
+       const EXCEPTION_FILTER_CHAIN_INTERCEPTED     = 0x03a;
 
        /**
         * Hexadecimal->Decimal translation array
@@ -1217,6 +1223,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $this->iteratorInstance;
        }
 
+       /**
+        * Setter for FrameworkFileInputOutputPointer instance
+        *
+        * @param       $pointerInstance        An instance of an FrameworkFileInputOutputPointer
+        * @return      void
+        */
+       protected final function setPointerInstance (FrameworkFileInputOutputPointer $pointerInstance) {
+               $this->pointerInstance = $pointerInstance;
+       }
+
+       /**
+        * Getter for FrameworkFileInputOutputPointer instance
+        *
+        * @return      $pointerInstance        An instance of an FrameworkFileInputOutputPointer
+        */
+       public final function getPointerInstance () {
+               return $this->pointerInstance;
+       }
+
        /**
         * Checks whether an object equals this object. You should overwrite this
         * method to implement own equality checks
@@ -2713,6 +2738,23 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Return it
                return $isValid;
        }
+
+       /**
+        * Translates boolean TRUE to 'Y' and FALSE to 'N'
+        *
+        * @param       $boolean                Boolean value
+        * @return      $translated             Translated boolean value
+        */
+       public static final function translateBooleanToYesNo ($boolean) {
+               // Make sure it is really boolean
+               assert(is_bool($boolean));
+
+               // "Translate" it
+               $translated = ($boolean === TRUE) ? 'Y' : 'N';
+
+               // ... and return it
+               return $translated;
+       }
 }
 
 // [EOF]