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 » Database » DB_DataObject » Bug #4188

update docs need clone() adding

Details

Submitted2005-04-20 14:50 UTC
Frompear at drn dot org
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version5.0.3
OSSolaris 9
Roadmaps(Not assigned)

Comments

[2005-04-20 14:50 UTC] pear at drn dot org

Description:
------------
The facility to update a row based on differences between a previous version doesn't appear to work.

The trace shows that UPDATE is never being called.

It update() works fine without the $original parameter - but this obviously means that every DB column is updated, rather than just those that have changed.

Reproduce code:
---------------
The following example from the documentation is an example that doesn't work:

person = new DataObjects_Person;
$person->get(12);
$original = $person; // clone or copy
$person->name='fred';
$person->update($original);

Expected result:
----------------
The system should perform the update.

Actual result:
--------------
Nothing - the system appears to simply ignore the update call.

[2005-04-20 15:10 UTC] pear at drn dot org

Doh! Apologies. Will think before writing in future...

Ben

[2005-04-20 15:25 UTC] pear at drn dot org

Bogus bug - unless you think the docs could do with a reminder for silly folk like me.