Pagekit\Database\Query\QueryBuilder::whereIn PHP Method

whereIn() public method

Creates and adds a "where in" to the query.
public whereIn ( string $column, mixed $values, boolean $not = false, string $type = null ) : self
$column string
$values mixed
$not boolean
$type string
return self
    public function whereIn($column, $values, $not = false, $type = null)
    {
        $params = [];
        if (is_array($values)) {
            $values = implode(', ', array_map([$this->connection, 'quote'], $values));
        } elseif ($values instanceof Closure) {
            $query = $this->newQuery();
            call_user_func($values, $query);
            $values = $query->getSQL();
            $params = $query->params();
        }
        $not = $not ? ' NOT' : '';
        return $this->addWhere("{$column}{$not} IN ({$values})", $params, $type);
    }