Re: RE : [PEAR] DataObject: upgrade from 1.2 to 1.3 problems
| From: | Jeroen Houben | Date: | Tue, 25 Nov 2003 09:19:57 +0000 |
| Subject: | Re: RE : [PEAR] DataObject: upgrade from 1.2 to 1.3 problems | ||
| References: | 1 2 3 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-9127@lists.php.net to get a copy of this message | ||
Hi Alan,
This was part of the plan to reduce the size of print_r, the data size (and theoretically improve performance..) things like select/condition/limit/order etc. are stored in an array which is cleared after a query. I already added this to ->get(), "You should avoid calling get on the same object instance twice, as this will result in unexpected results." The Changelog should have flagged this - "You may not run a find on an object that has already had this run on it.." But I forgot to add it to the changelog :( Previously I did the clearing of the query on fetch(), but this adds an extra call to the fetch method, (and slows things down a little..) prehaps just going back to this, and doing a simple variable check is the best compramise.. You mean you will go back to the old behaviour in the next release? That would be nice. Not being able to run find() twice on the same object seems very counter intuitive to me. Any thoughts on the problem I'm having with selectAdd? For full description please see previous post (near the bottom) http://marc.theaimsgroup.com/?l=pear-general&m=106968008924496&w=2Thanks! Jeroen
Regards Alan Jeroen Houben wrote:Why though? And isn't this a BC break? My second error definately sounds like a BC break, although it might just be a result of the first error. LIMBOURG Arnaud wrote:Hi, I had the same message, you can avoid it by doing $do_1 = new DataObject; $do_2 = $do_1->__clone(); $do_1->find(); About the second error, i don't know. Arnaud.thw Var_Dump() call gives me a message: You cannot do two queries on the same object (copy it before finding) Also I get notices: Notice: Undefined property: start_stamp in xxx on line 99 Notice: Undefined property: end_stamp in xxx on line 100 This must have something to do with the selectAdd not working as it worked before (?) Help much appreciated,