Allowed to set extra instance (for special cases, okay).
[core.git] / inc / classes / main / helper / class_BaseHelper.php
index 8011081af8da8de89aab160e93e5a3de76eb160d..45b74bb3cf1a33d1ed7ee866f06003e73e47ded0 100644 (file)
@@ -149,6 +149,16 @@ class BaseHelper extends BaseFrameworkSystem {
                return $this->content;
        }
 
+       /**
+        * Public setter for extra instance
+        *
+        * @param       $extraInstance  An extra instance of FrameworkInterface to set
+        * @return      void
+        */
+       public final function setExtraInstance (FrameworkInterface $extraInstance) {
+               $this->extraInstance = $extraInstance;
+       }
+
        /**
         *  Assigns a field from the value instance with a template variable
         *
@@ -453,13 +463,14 @@ class BaseHelper extends BaseFrameworkSystem {
 
                // Get the field value
                $fieldValue = $this->getValueInstance()->getField($fieldName);
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).')');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - BEFORE!');
 
                // Is it null?
                if ((is_null($fieldValue)) && (!is_null($this->extraInstance))) {
                        // So try the extra instance
                        $fieldValue = $this->extraInstance->getField($fieldName);
                } // END - if
+               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - AFTER!');
 
                // Return it
                return $fieldValue;