Home » Structures » Structures_DataGrid_DataSource_DBTable » Bug #8322
Too strict DB_Table comparison
Details
| Request #8322 | Too strict DB_Table comparison |
|---|---|
| Submitted | 2006-07-30 05:32 UTC |
| From | julesvanvelzen at gmail dot com |
| Assigned | wiesemann |
| Status | Closed |
| Package | Structures_DataGrid_DataSource_DBTable |
| PHP Version | Irrelevant |
| OS | WINNT/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.