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