PEAR is archived and read-only

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

Home » Structures » Structures_DataGrid » Bug #2123

Record_DataObject does not recognize DataObject's grand-children

Details

Submitted2004-08-14 21:14 UTC
Fromylf at xung dot org
Assignedasnagy
StatusClosed
PackageStructures_DataGrid
PHP Version4.3.4
OSLinux Debian (testing)
Roadmaps(Not assigned)

Comments

[2004-08-14 21:14 UTC] ylf at xung dot org

Description:
------------
Hi Andrew,

In DG_R_DO::setRecord() you state :

if (strtolower(get_parent_class($data)) == 'db_dataobject')

This is wrong as it's possible (and common) to use an intermediate class as below :

class DO_Common extends DB_DataObject {
}

class User extends DO_Common {
}

See: with setRecord($user), get_parent_class will return "DO_Common".

You need to use : is_subclass_of($data,'db_dataobject')

--
Olivier Guilyardi

[2004-08-16 15:50 UTC] asnagy at webitecture dot org

This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.

Thank you for the report, and for helping us make PEAR better.