X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmain%2Fclasses%2Fhelper%2Fclass_BaseHelper.php;h=34958ab05b052e729366a0dd959a362a50eaf390;hb=9834f12b6c4754df364ae966d87ba389718a05a0;hp=192a51a1cbb8b05f1748bbc2b212838c76af5c6c;hpb=4ef89c509993560a05ccdb56d02e2884510ec2de;p=core.git diff --git a/inc/main/classes/helper/class_BaseHelper.php b/inc/main/classes/helper/class_BaseHelper.php index 192a51a1..34958ab0 100644 --- a/inc/main/classes/helper/class_BaseHelper.php +++ b/inc/main/classes/helper/class_BaseHelper.php @@ -5,6 +5,7 @@ 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; @@ -194,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)); @@ -212,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? @@ -231,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? @@ -477,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');