presty Posted September 19, 2012 Share Posted September 19, 2012 Hi, Has anyone noticed the query builder that is used in some of the PS 1.5 modules? The class DbQueryCore allows to "build" queries in a different way. Even though, in the 1.5 documentation section "DB class best practices" there is nothing about the query builder. http://doc.prestasho...+best+practices I imagine it is recommended for new developments.. Is there anyone there using it? Link to comment Share on other sites More sharing options...
masoud2011 Posted January 19, 2013 Share Posted January 19, 2013 now it is available in this link http://doc.prestashop.com/display/PS15/Diving+into+PrestaShop+Core+development#DivingintoPrestaShopCoredevelopment-TheDBQueryclass it is good but not complete it's select function could be better and could accept array too if we change it to this form /** * Add fields in query selection * * @param mixed $fields List of fields to concat to other fields * @return DbQuery */ public function select($mFields) { if( is_array($mFields) && count($mFields) > 0) array_merge( $this->aQuery['select'],$mFields); else if ( !empty($mFields) ) $this->aQuery['select'][] = $mFields ; return $this ; } and many module want to have their specific DB prefix so DB_PRIFIX should be optinal Link to comment Share on other sites More sharing options...
Recommended Posts