Home » Database » DB_DataObject » Bug #3098
$do->_lastError not accessible through PEAR::getStaticVariable()
Details
| Submitted | 2005-01-04 21:03 UTC |
|---|---|
| From | ate2 at cornell dot edu |
| Assigned | alan_k |
| Status | Closed |
| Package | DB_DataObject |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-01-04 21:03 UTC] ate2 at cornell dot edu
Description:
------------
DBDO documentation says you can access the _lastError
property in two ways:
1. directly
2. through PEAR::getStaticProperty()
The 2nd option doesn't seem to work and there's nothing
in the code to suggest that it should work (no calls to
set up such a reference in the first place).
Although it's easy enough to get around this by writing
my own fixes I think it does make sense to provide a
standard, public way to access the last error.
Also it would be helpful if there were a way to access
the last error for a specific instance of DBDO (i.e.
$do->lastError() and $do->staticLastError() )
Reproduce code:
---------------
$e2 = &PEAR::getStaticProperty(
"DB_DataObject",
"lastError"
);
$e =& $record->_lastError;
if (PEAR::isError($e)) {
$db->rollback();
echo "<pre>\nError:\n";
print_r($e2);
echo "</pre>";
exit;
}
Expected result:
----------------
Error:
DB_DataObject_Error object (
... lots of stuff here ...
)
Actual result:
--------------
Error: