]> git.mxchange.org Git - core.git/blobdiff - inc/main/classes/helper/class_BaseHelper.php
Continued:
[core.git] / inc / main / classes / helper / class_BaseHelper.php
index 2e788593472fde84e82523db0a16fcea2487c320..34958ab05b052e729366a0dd959a362a50eaf390 100644 (file)
@@ -1,4 +1,14 @@
 <?php
+// Own namespace
+namespace CoreFramework\Helper;
+
+// Import framework stuff
+use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Generic\FrameworkInterface;
+use CoreFramework\Generic\NullPointerException;
+use CoreFramework\Object\BaseFrameworkSystem;
+use CoreFramework\Registry\Generic\Registry;
+
 /**
  * A generic helper class with generic methods
  *
@@ -185,7 +195,7 @@ class BaseHelper extends BaseFrameworkSystem {
        public function assignFieldWithFilter ($fieldName, $filterMethod) {
                // Get the value
                $fieldValue = $this->getValueField($fieldName);
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'='.$fieldValue);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'='.$fieldValue);
 
                // Now filter it through the value through the filter method
                $filteredValue = call_user_func_array(array($this, 'doFilter' . self::convertToClassName($filterMethod)), array($fieldValue));
@@ -203,14 +213,14 @@ class BaseHelper extends BaseFrameworkSystem {
         * @throws      NullPointerException    If recovery of requested value instance failed
         */
        public function prefetchValueInstance ($registryKey, $extraKey = NULL) {
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('O:'.$registryKey.'/'.$extraKey);
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('O:'.$registryKey.'/'.$extraKey);
                try {
                        // Get the required instance
                        $this->valueInstance = Registry::getRegistry()->getInstance($registryKey);
                } catch (NullPointerException $e) {
                        // Not set in registry
                        // @TODO Try to log it here
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($registryKey.'=NULL!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($registryKey.'=NULL!');
                }
 
                // Shall we get an extra instance?
@@ -222,7 +232,7 @@ class BaseHelper extends BaseFrameworkSystem {
                                // Try to create it
                                $this->extraInstance = ObjectFactory::createObjectByConfiguredName($extraKey . '_class', array($this->valueInstance));
                        }
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($extraKey.'='.$this->extraInstance.' - EXTRA!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($extraKey.'='.$this->extraInstance.' - EXTRA!');
                } // END - if
 
                // Is the value instance valid?
@@ -468,11 +478,11 @@ class BaseHelper extends BaseFrameworkSystem {
                if ($this->getValueInstance()->isFieldSet($fieldName)) {
                        // Get the field value
                        $fieldValue = $this->getValueInstance()->getField($fieldName);
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Value instance!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Value instance!');
                } elseif ((!is_null($this->extraInstance)) && ($this->extraInstance->isFieldSet($fieldName))) {
                        // So try the extra instance
                        $fieldValue = $this->extraInstance->getField($fieldName);
-                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Extra instance!');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Extra instance!');
                } else {
                        // Field is not set
                        $this->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] fieldName=' . $fieldName . ' is not set! - @TODO');
@@ -548,7 +558,5 @@ class BaseHelper extends BaseFrameworkSystem {
        protected final function setPreviousSubGroupId ($previousSubGroupId) {
                $this->previousSubGroupId = (string) $previousSubGroupId;
        }
-}
 
-// [EOF]
-?>
+}