[*] CO : Empty parameters are not added
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9690 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
9c368349f2
commit
103eb9a9c1
1 file changed
+37
-12
+37
-12
@@ -54,7 +54,8 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function select($fields)
|
public function select($fields)
|
||||||
{
|
{
|
||||||
$this->query['select'][] = $fields;
|
if (!empty($fields))
|
||||||
|
$this->query['select'][] = $fields;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +67,8 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function from($table)
|
public function from($table)
|
||||||
{
|
{
|
||||||
$this->query['from'] = _DB_PREFIX_.$table;
|
if (!empty($table))
|
||||||
|
$this->query['from'] = _DB_PREFIX_.$table;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +81,9 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function join($join)
|
public function join($join)
|
||||||
{
|
{
|
||||||
$this->query['join'][] = $join;
|
if (!empty($join))
|
||||||
|
$this->query['join'][] = $join;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +95,10 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function leftJoin($join)
|
public function leftJoin($join)
|
||||||
{
|
{
|
||||||
return $this->join('LEFT JOIN '._DB_PREFIX_.$join);
|
if (!empty($join))
|
||||||
|
return $this->join('LEFT JOIN '._DB_PREFIX_.$join);
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -102,7 +109,10 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function innerJoin($join)
|
public function innerJoin($join)
|
||||||
{
|
{
|
||||||
return $this->join('INNER JOIN '._DB_PREFIX_.$join);
|
if (!empty($join))
|
||||||
|
return $this->join('INNER JOIN '._DB_PREFIX_.$join);
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,7 +122,10 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function leftOuterJoin($join)
|
public function leftOuterJoin($join)
|
||||||
{
|
{
|
||||||
return $this->join('LEFT OUTER JOIN '._DB_PREFIX_.$join);
|
if (!empty($join))
|
||||||
|
return $this->join('LEFT OUTER JOIN '._DB_PREFIX_.$join);
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,7 +135,10 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function naturalJoin($join)
|
public function naturalJoin($join)
|
||||||
{
|
{
|
||||||
return $this->join('NATURAL JOIN '._DB_PREFIX_.$join);
|
if (!empty($join))
|
||||||
|
return $this->join('NATURAL JOIN '._DB_PREFIX_.$join);
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -133,7 +149,9 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function where($restriction)
|
public function where($restriction)
|
||||||
{
|
{
|
||||||
$this->query['where'][] = $restriction;
|
if (!empty($restriction))
|
||||||
|
$this->query['where'][] = $restriction;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +163,9 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function having($restriction)
|
public function having($restriction)
|
||||||
{
|
{
|
||||||
$this->query['having'][] = $restriction;
|
if (!empty($restriction))
|
||||||
|
$this->query['having'][] = $restriction;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +177,9 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function orderBy($fields)
|
public function orderBy($fields)
|
||||||
{
|
{
|
||||||
$this->query['order'][] = $fields;
|
if (!empty($fields))
|
||||||
|
$this->query['order'][] = $fields;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +191,9 @@ class DbQueryCore
|
|||||||
*/
|
*/
|
||||||
public function groupBy($fields)
|
public function groupBy($fields)
|
||||||
{
|
{
|
||||||
$this->query['group'][] = $fields;
|
if (!empty($fields))
|
||||||
|
$this->query['group'][] = $fields;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,4 +257,5 @@ class DbQueryCore
|
|||||||
{
|
{
|
||||||
return $this->build();
|
return $this->build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user