* @return void
*/
public function debugOutput ($message, $doPrint = true) {
- // Get debug instance
- $debugInstance = $this->getDebugInstance();
+ // Set debug instance to NULL
+ $debugInstance = NULL;
+
+ // Try it:
+ try {
+ // Get debug instance
+ $debugInstance = $this->getDebugInstance();
+ } catch (NullPointerException $e) {
+ // The debug instance is not set (yet)
+ }
// Is the debug instance there?
if (is_object($debugInstance)) {
$fieldArray = $resultInstance->current();
//* DEBUG: */ $this->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
+ // Convert dashes to underscore
+ $fieldName = $this->convertDashesToUnderscores($fieldName);
+
// Does the field exist?
if (isset($fieldArray[$fieldName])) {
// Get it
$fieldValue = $fieldArray[$fieldName];
- } // END - if
+ } else {
+ // Missing field entry, may require debugging
+ $this->debugOutput($this->__toString() . ':fieldname=' . $fieldName . ' not found!');
+ }
// Return it
return $fieldValue;