I'm very unhappy with the error message that I'm giving in this
method:
/**
* 11-23-03 - getter
*
* We want to run the query against a MySql database and get back a
resource pointer to the retrieved dataset
*
* returns resource pointer (to dataset)
*/
function getInfo() {
if ($this->query) {
$dsResultPointe r = $this->datastoreConne ctor->query($this->query);
if (is_resource($d sResultPointer) ) {
return $dsResultPointe r;
} else {
$this->resultsObjec t->addToErrorResu lts("In getInfo(), in the
class McQueryObject, when we ran a query against the database we
expected to get back a resouce pointer to the retrieved dataset but we
did not.");
}
} else {
$this->resultsObjec t->addToErrorResu lts("In getInfo(), in the class
McQueryObject, the query could not be run because there was no query.
The most likely reason for this is that the programmer forgot to call
setInfoToBeSoug ht().");
}
}
The truth is, it will never, ever be called from McQueryObject. It
will always be called from a subclass, and the name of that subclass
is the only thing that would make this error message useful. I looked
at all the class methods listed here:
http://de3.php.net/manual/en/function.get-class.php
But it doesn't seem like there is a method for me to find out from
what class a method is being called.