DataObject error notice when no results
| From: | Jeroen Houben | Date: | Fri, 24 Jan 2003 12:16:40 +0000 |
| Subject: | DataObject error notice when no results | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-12695@lists.php.net to get a copy of this message | ||
Hi Alan,
the following code will result in a notice "Notice: Undefined variable: this in
/usr/local/share/php/pear/DB/DataObject.php on line 1719"
$subs = DataObjects_Meet_subscriptions::staticGet('eventID',10);
But _only_ when there are no records in the DB with eventID=10.
I added @ to the function is_object($this) on line 1719 to fix this, but I don't
know if I'm doing something wrong in the first place are if this is really a small
bug. Perhaps I shouldn't use staticGet when I don't know for sure that it will
return rows (?).
Thanks
Jeroen