X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fhelper%2Fclass_BaseHelper.php;h=0b7e06ad5ce3f3f24ba5f7e248d6a30adb5192cc;hp=7a0a77b6c1cbf0584bbb8e86a6bfb9abffbb18c6;hb=04bc89cf40643171b26be910fef8c48d08b346fb;hpb=b62e63b770f153ad80c2dcf4f85b9111f1618469 diff --git a/inc/classes/main/helper/class_BaseHelper.php b/inc/classes/main/helper/class_BaseHelper.php index 7a0a77b6..0b7e06ad 100644 --- a/inc/classes/main/helper/class_BaseHelper.php +++ b/inc/classes/main/helper/class_BaseHelper.php @@ -4,7 +4,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -25,12 +25,12 @@ class BaseHelper extends BaseFrameworkSystem { /** * Instance to the class which provides field values */ - private $valueInstance = null; + private $valueInstance = NULL; /** * Extra instance to the class which provides field values */ - private $extraInstance = null; + private $extraInstance = NULL; /** * Rendered content created by the helper class @@ -63,9 +63,6 @@ class BaseHelper extends BaseFrameworkSystem { private $totalCounter = 0; // Exception constants - const EXCEPTION_XML_PARSER_ERROR = 0x1e0; - const EXCEPTION_XML_NODE_UNKNOWN = 0x1e1; - const EXCEPTION_XML_NODE_MISMATCH = 0x1e2; const EXCEPTION_GROUP_NOT_OPENED = 0x1e3; const EXCEPTION_GROUP_ALREADY_FOUND = 0x1e4; const EXCEPTION_SUB_GROUP_ALREADY_FOUND = 0x1e5; @@ -90,7 +87,7 @@ class BaseHelper extends BaseFrameworkSystem { * @return void */ protected final function addContent ($newContent) { - $this->content .= (string) trim($newContent) . "\n"; + $this->content .= (string) trim($newContent) . PHP_EOL; } /** @@ -178,7 +175,7 @@ class BaseHelper extends BaseFrameworkSystem { public function assignFieldWithFilter ($fieldName, $filterMethod) { // Get the value $fieldValue = $this->getValueField($fieldName); - //* DEBUG: */ $this->debugOutput($fieldName.'='.$fieldValue); + //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'='.$fieldValue); // Now filter it through the value through the filter method $filteredValue = call_user_func_array(array($this, 'doFilter' . $this->convertToClassName($filterMethod)), array($fieldValue)); @@ -195,15 +192,15 @@ class BaseHelper extends BaseFrameworkSystem { * @return void * @throws NullPointerException If recovery of requested value instance failed */ - public function prefetchValueInstance ($registryKey, $extraKey = null) { - //* DEBUG: */ $this->debugOutput('O:'.$registryKey.'/'.$extraKey); + public function prefetchValueInstance ($registryKey, $extraKey = NULL) { + //* DEBUG: */ self::createDebugInstance(__CLASS__)->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: */ $this->debugOutput($registryKey.'=NULL!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($registryKey.'=NULL!'); } // Shall we get an extra instance? @@ -215,7 +212,7 @@ class BaseHelper extends BaseFrameworkSystem { // Try to create it $this->extraInstance = ObjectFactory::createObjectByConfiguredName($extraKey . '_class', array($this->valueInstance)); } - //* DEBUG: */ $this->debugOutput($extraKey.'='.$this->extraInstance.' - EXTRA!'); + //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($extraKey.'='.$this->extraInstance.' - EXTRA!'); } // END - if // Is the value instance valid? @@ -394,7 +391,7 @@ class BaseHelper extends BaseFrameworkSystem { // Is header content there? if (isset($this->groups['header'])) { // Then add it - $content .= $this->groups['header']['content'] . "\n"; + $content .= $this->groups['header']['content'] . PHP_EOL; } // END - if // Initiate content @@ -422,7 +419,7 @@ class BaseHelper extends BaseFrameworkSystem { // Is footer content there? if (isset($this->groups['footer'])) { // Then add it - $content .= $this->groups['footer']['content'] . "\n"; + $content .= $this->groups['footer']['content'] . PHP_EOL; } // END - if // Return it @@ -431,10 +428,10 @@ class BaseHelper extends BaseFrameworkSystem { } /** - * Checks wether the specified group is opened + * Checks whether the specified group is opened * * @param $groupId Id of group to check - * @return $isOpened Wether the specified group is open + * @return $isOpened Whether the specified group is open */ protected function ifGroupIsOpened ($groupId) { // Is the group open? @@ -460,7 +457,7 @@ class BaseHelper extends BaseFrameworkSystem { // Get the field value $fieldValue = $this->getValueInstance()->getField($fieldName); - //* DEBUG: */ $this->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).')'); + //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).')'); // Is it null? if ((is_null($fieldValue)) && (!is_null($this->extraInstance))) { @@ -482,9 +479,9 @@ class BaseHelper extends BaseFrameworkSystem { } /** - * Check wether a group was opened previously + * Check whether a group was opened previously * - * @return $groupOpened Wether any group was opened before + * @return $groupOpened Whether any group was opened before */ protected final function ifGroupOpenedPreviously () { $groupOpened = (!empty($this->previousGroupId)); @@ -492,9 +489,9 @@ class BaseHelper extends BaseFrameworkSystem { } /** - * Check wether a group was opened previously + * Check whether a group was opened previously * - * @return $subGroupOpened Wether any group was opened before + * @return $subGroupOpened Whether any group was opened before */ protected final function ifSubGroupOpenedPreviously () { $subGroupOpened = (!empty($this->previousSubGroupId));