/** * Adds condition, more calls appends with AND. * @param string condition possibly containing ? * @return void */ protected function condition($condition, array $params, $tableChain = NULL) { $this->emptyResultSet(); if (is_array($condition) && $params === []) { // where(array('column1' => 1, 'column2 > ?' => 2)) foreach ($condition as $key => $val) { if (is_int($key)) { $this->condition($val, [], $tableChain); // where('full condition') } else { $this->condition($key, [$val], $tableChain); // where('column', 1) } } } elseif ($tableChain) { $this->sqlBuilder->addJoinCondition($tableChain, $condition, ...$params); } else { $this->sqlBuilder->addWhere($condition, ...$params); } }