PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Structures » Structures_DataGrid_DataSource_DBTable » Bug #8322

Too strict DB_Table comparison

Details

Request #8322Too strict DB_Table comparison
Submitted2006-07-30 05:32 UTC
Fromjulesvanvelzen at gmail dot com
Assignedwiesemann
StatusClosed
PackageStructures_DataGrid_DataSource_DBTable
PHP VersionIrrelevant
OSWINNT/2000
Roadmaps(Not assigned)

Comments

[2006-07-30 05:32 UTC] julesvanvelzen at gmail dot com

Description:
------------
use: CSV file id: $Id: DBTable.php,v 1.12 2006/07/06 15:39:07 wiesemann Exp

around line 103 of the function bind the object gets tested against the parent class db_table, in my opinion it should be tested against its subclass of, like the rest of this package does; it is common use to generalize some 'system' behaviour by extending DB_Table, the extended DB_Table class will then be subclassed for each specific table, thus 'get_parent_class' does not really get the job done, _unless_ it was meant to be that strict, though, then the _detectSourceType in the main class should handle this scrictness too.

Test script:
---------------
/**
* part of function bind found around line 103
* the line marked # should be replaced by the next line.
* the line marked /// ... implies the body should continue
* as it was
*/
function bind(&$object, $options=array())
{
#if (strtolower(get_parent_class($object)) == 'db_table') {
if (is_subclass_of($object,'db_table')) {
$this->_object =& $object;
} /// ...
}

[2006-07-30 05:40 UTC] julesvanvelzen at gmail dot com

Oops, I assumed PEAR automatically downloaded the latest version, but I see here at the CVS in version 1.15 the problem is solved.