Jump to content

PS 1.5 query builder


Recommended Posts

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

  • 4 months later...

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

×
×
  • Create New...