public function inWhere($expr, $values)
{
if ($values instanceof $this) {
$this->andWhere($expr . ' IN (' . $values->getSql() . ')');
$this->_bind = array_merge($this->_bind, $values->getBind());
} else {
if (count($values) === 0) {
$this->andWhere('1=2');
return $this;
}
$bind = [];
$bindKeys = [];
/** @noinspection ForeachSourceInspection */
foreach ($values as $k => $value) {
$key = '_in_' . self::$_hiddenParamNumber . '_' . $k;
$bindKeys[] = ":{$key}";
$bind[$key] = $value;
}
self::$_hiddenParamNumber++;
$this->andWhere($expr . ' IN (' . implode(', ', $bindKeys) . ')', $bind);
}
return $this;
}