PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #3098

$do->_lastError not accessible through PEAR::getStaticVariable()

Details

Submitted2005-01-04 21:03 UTC
Fromate2 at cornell dot edu
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP VersionIrrelevant
OSIrrelevant
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: