/**
* Class for performing the search
*
* @author Phil Powell
* @version 1.0.0
* @package IMAGE_CATALOG
* @see db_action.inc.php:DBActionPerformer
*/
class SearchPerformer extends DBActionPerformer {
/**
* This static method will determine if the element passed here (by the value of $elementName as parameter) has a value, even if it is an array
*
* @access private
* @param mixed $elementName
* @param mixed $section
* @return boolean
*/
function &isElement($elementName, $section) { // STATIC BOOLEAN METHOD
global ${$elementName}; // PASS VALUE HERE
switch ($section) {
case 'image': // SPECIFIC IMAGE-RELATED HANDLING OF $this->formFieldsArray
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------
Also note that you have to call Accepter "statically" (class-level) instead of instantiating the object, otherwise,
you will be instantiating $this->validate(), causing a n^2 loop construct of an unnecessary validation call, which is
way bad! However, the property cannot be called directly in PHP versions 4 due to language constraints (if someone knows how
let *ME* know!) so you have to use a static getter method to retrieve it
-----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
print_r(is_array(${$elementName})); print_r(" "); print_r(@sizeof(array_values(${$elementName}))); print_r(' '); print_r(${$elementName}); print_r(" "); echo Accepter::getNullExemptionArray($section, $elementName); print_r("<P>");
if (is_array(${$elementName}) && @sizeof(array_values(${$elementName})) > 0) {
return true;
} elseif (${$elementName} && ${$elementName} !== Accepter::getNullExemptionArray($section, $elementName)) {
return true;
} else {
return false;
}
break;
default: // DO NOTHING FOR NOW
break;
}
}
}
The following method in the class function:
print_r(is_array(${$elementName})); print_r(" "); print_r(@sizeof(array_values(${$elementName}))); print_r(' '); print_r(${$elementName}); print_r(" "); echo Accepter::getNullExemptionArray($section, $elementName); print_r("<P>");
Produces this error:
Fatal error: Call to undefined function: getnullexemptionarray() in /include/search_action.inc.php on line 267
However, if I comment out line 267 and you follow THIS line:
} elseif (${$elementName} && ${$elementName} !== Accepter::getNullExemptionArray($section, $elementName)) {
return true;
Then the class method works w/o a single fatal error whatsoever, and I even verified with the following:
print_r("elementName = $elementName = ${$elementName}<P>");
To verify if ${$elementName} exists thus possibly meeting (or not meeting) the conditon.
So now, why is it that on one line, Accepter::getNullExemptionArray() produces an "undefined function" fatal error, but in another line, same class, same method, it produces no errors at all???
What am I missing this time?
Phil