DB_DataObject::get() always returns true
| From: | Jeff Loiselle | Date: | Fri, 16 Sep 2005 12:17:39 +0000 |
| Subject: | DB_DataObject::get() always returns true | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-21006@lists.php.net to get a copy of this message | ||
According to the documentation, this should work:
if ($person->get(12)) {
print_r($person);
} else {
echo "NO person 12 exists";
}
However, the get method always returns true. Now I believe this is the intended behavior, as the class will return a new instance of the object, if it does not exist. It also does not supply an error. So, how do I check to see if the record actually exists in the database, without checking on a specific field?