PEAR is archived and read-only

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

Home » Structures » Structures_DataGrid_DataSource_DBTable » Bug #8238

bind only accepts direct ancestor of DB_Table object, shoul accept any subclass

Details

Submitted2006-07-18 14:04 UTC
Fromgramlich at eosc dot de
Assignedwiesemann
StatusClosed
PackageStructures_DataGrid_DataSource_DBTable
PHP Version4.3.2
Roadmaps(Not assigned)

Comments

[2006-07-18 14:04 UTC] gramlich at eosc dot de

Description:
------------
In DataGrid->_detectSourceType() any subclass is allowed.
This is the desired behaviour. It is not done like this in
DBTable (maybe applies to other sources, too).

Please change line 103 in DBTable.php not to use
get_parent_class

--- DBTableBAK.php 2006-07-06 17:39:29.000000000
+0200
+++ DBTable.php 2006-07-18 15:57:18.372794780 +0200
@@ -100,7 +100,7 @@
*/
function bind(&$object, $options=array())
{
- if (strtolower(get_parent_class($object)) ==
'db_table') {
+ if (is_object($object) && is_subclass_of($object,
'db_table')) {
$this->_object =& $object;
} else {
return PEAR::raiseError(