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

Bug #8106 Moving creation of _options['fields'] outside of fetch() loop
Submitted: 2006-07-03 08:46 UTC
From: michel dot dhooge at gmail dot com Assigned: olivierg
Status: Closed Package: Structures_DataGrid_DataSource_DataObject (version CVS)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 20 + 44 = ?

 
 [2006-07-03 08:46 UTC] michel dot dhooge at gmail dot com (Michel D'HOOGE)
Description: ------------ The test "if (!$this->_options['fields'])" is inside the DB_DO::fetch() loop of the SDG_DS_DO::fetch() method. Since it is true at most on the first iteration, it could be moved before the loop (maybe within the bind() method). The only reason I can see to leave the test within the loop is if some variables are not pre-defined in the DB_DO object (as it is always the case with the default object creation) and are created on the fly when DB_DO::fetch() is called. IMHO quite unlikely... HTH

Comments

 [2007-02-09 11:54 UTC] olivierg at php dot net (Olivier Guilyardi)
Hi, I did not exactly move the test out of the fetch loop, because DBDO::fetch() must be call beofre DBDO::toArray(), and I dislike do {} while statements. However I've implemented a simple boolean check so that this code segment is only ran on the initial iteration. I also removed the unneeded $fieldList variable. That's all in CVS. Thanks for your report