Browse Source

Move empty check to a more general purpose place.

empty values generally misbehave in all the various parts of query
building so we'll omit them.
Mark Story 10 years ago
parent
commit
39e9863a25
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/Database/Query.php

+ 3 - 3
src/Database/Query.php

@@ -755,9 +755,6 @@ class Query implements ExpressionInterface, IteratorAggregate
      */
     public function where($conditions = null, $types = [], $overwrite = false)
     {
-        if (empty($conditions)) {
-            return $this;
-        }
         if ($overwrite) {
             $this->_parts['where'] = $this->newExpr();
         }
@@ -1646,6 +1643,9 @@ class Query implements ExpressionInterface, IteratorAggregate
      */
     protected function _conjugate($part, $append, $conjunction, $types)
     {
+        if (empty($append)) {
+            return;
+        }
         $expression = $this->_parts[$part] ?: $this->newExpr();
 
         if (!is_string($append) && is_callable($append)) {