Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Bug #35 subsequent get() calls only update 'id' field
Submitted: 2003-09-25 19:32 UTC
From: ieure at debian dot org Assigned:
Status: Bogus Package: DB_DataObject
PHP Version: 4.3.2 OS: Debian unstable
Roadmaps: (Not assigned)    
Subscription  


 [2003-09-25 19:32 UTC] ieure at debian dot org
Description: ------------ If I create a single DataObject, and call get() twice with two different keys, the only field updated after the second get() is the first key from $keys. this is what's in my database: database=# select id, firstname, lastname, username from users; id | firstname | lastname | username ----+-----------+----------+---------- 14 | Ian | Eure | ieure 18 | Test | User | test (2 rows) Reproduce code: --------------- $o = new DataObjects_Users; $o->get(14); print_r($o); $o->get(18); print_r($o); Expected result: ---------------- I expect $o to contain all the correct fields corresponding to user 18 in the database, e.g. $o->firstname = 'Test'; $o->lastname = 'User; $o->username = 'test'; Actual result: -------------- $o->id contains '18', and the rest of the fields contain the values from object '14'. e.g. $o->firstname = 'Ian'; $o->lastname = 'Eure'; $o->username = 'ieure';

Comments

 [2003-09-25 23:40 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-04-08 21:56 UTC] tom at gocom dot ca
I recently tried to do the same thing. Read documentation, and yes, the object performs as specified. None the less, multiple gets would be logical building out of the object and should be considered in a future version. I love what you have done so far, but I hate to reach a point where the benefit of getting more functionality requires me to build my own dataobject. I would rather build on your well thought out foundation. I am willing to code a solution if you integrate it into the package.