@param   array $where

@return  string
181885
protected function whereBetween(array $where)
    {
        return $this->wrap($where['column']) . ' ' . ($where['not'] ? 'NOT BETWEEN' : 'BETWEEN') . ' ' . $this->param($where['value1']) . ' AND ' . $this->param($where['value2']);
    }
1308533
private static function prepareStatement(array $where): array
    {
        $keys = array_keys($where);
        foreach ($keys as &$key) {
            $key = DbProxy::quoteIdentifier($key) . ' = ?';
        }
        return $keys;
    }
655665
public function buildWherePlaceholderName($where)
    {
        $whereStr = '';
        $i = 0;
        foreach ($where as $key => $value) {
            if ($i == 0) {
                $whereStr .= "$key = :$key";
            } else {
                $whereStr .= " AND $key = :$key";
            }

            $i++;
        }

        return ' WHERE '.ltrim($whereStr, ' AND ');
    }
1190550
public function where($where = null)
    {
        if ($where === null) {
            return $this->where;
        }
        $this->where = $where;

        return $this->where;
    }
97896
public function findWhere(array $where, $columns = ['*'])
    {
        $this->applyCriteria();
        $this->applyScope();

        $this->applyConditions($where);

        $model = $this->model->get($columns);
        $this->resetModel();

        return $this->parserResult($model);
    }
816555
public function buildQuery(string $table, array $where): SqlParams
    {
        $whereClause = $this->buildWhereClause($where);
        $sql = "DELETE FROM {$table}" . $whereClause->getSql();
        return new SqlParams($sql, $whereClause->getParams());
    }
351078
protected function prepare($where)
    {
        if (is_string($where)) {
            return str_replace('{@}', $this->alias, $where);
        }

        if (!is_array($where)) {
            return $where;
        }

        $result = [];
        foreach ($where as $column => $value) {
            if (is_string($column) && !is_int($column)) {
                $column = str_replace('{@}', $this->alias, $column);
            }

            $result[$column] = !is_array($value) ? $value : $this->prepare($value);
        }

        return $result;
    }
920845
public function update(array $data, array $where)
    {
        if (!$where) {
            die ('Where is required');
        }

        if (!$data) {
            die ('Data is required');
        }

        return $this->_update($data, $where);
    }
1207646
protected function where($where)
    {
        foreach($where as $field => $value) {
            $this->queryBuilder->where($field, $value);
        }
    }
635440
public function findWhere(array $where, $columns = ['*'])
    {
        $this->newQuery();

        foreach ($where as $field => $value) {
            if (is_array($value)) {
                list($field, $condition, $val) = $value;
                $this->query->where($field, $condition, $val);
            }
            else {
                $this->query->where($field, '=', $value);
            }
        }

        return $this->query->get($columns);
    }
443273
protected function compileWhere(array $where)
    {
        // Get the name of the operator.
        if ($name = array_search($where['operator'], Operator::all())) {
            // If the name was found we'll camel case it
            // to run it through the compile method.
            $method = 'compile'.ucfirst($name);

            // Make sure the compile method exists for the operator.
            if (method_exists($this, $method)) {
                return $this->{$method}($where['field'], $where['value']);
            }
        }
    }
400763
public function prepareWhere($wheres = null)
    {
        if (isset($wheres)) {
            if (!empty($wheres)) {
                $wheres = ' WHERE '.implode(' and ', array_values($wheres));
            } else {
                $wheres = '';
            }
        } else {
            $wheres = '';
        }

        return $wheres;
    }
1374296
public function delete($table, array $where)
    {
        $keys = array_keys($where);
        $values = array_values($where);

        $replace = function ($key) { return $key . "=?"; };

        $where = implode(' AND ', array_map($replace, $keys));

        $sql = "DELETE FROM {$table} WHERE {$where}";

        return $this->query($sql, $values);
    }
622791
protected function whereSubquery(array $where)
    {
        return $this->wrap($where['column']) . ' ' . $where['operator'] . ' (' . $this->select($where['subquery']->getSQLStatement()) . ')';
    }
245189
public function deleteWhere(array $where)
    {
        $this->applyScope();

        $temporarySkipPresenter = $this->skipPresenter;
        $this->skipPresenter(true);

        $this->applyConditions($where);

        $deleted = $this->model->delete();

        event(new RepositoryEntityDeleted($this, $this->model->getModel()));

        $this->skipPresenter($temporarySkipPresenter);
        $this->resetModel();

        return $deleted;
    }
1215192
public function fetchCount($where=array()) {
        $obj = $this->getConnection();
        if (empty($where) == false) {
            foreach ($where as $key => $value) {
                $obj->where($key, $value);
            }
        }
        $count = $obj->getValue($this->getDao()->getTableName(), 'count(1)');
        return (int)$count;
	}
1372407
private function formatWhere($where, $operator = 'AND')
    {
        if (is_string($where)) {
            return $where;
        }

        $fullWhere = [];

        if (is_array($where)) {
            foreach ($where as $key => $value) {
                $fullWhere[] = sprintf(
                    '%s = %s',
                    $this->quoteIdentifier($key),
                    $this->quote($value)
                );
            }
        } elseif (is_a($where, 'Database\Query\Where')) {
            $operator = $where->getOperator();
            $whereClause = $where->getWhereClause();

            if (!empty($whereClause)) {
                foreach ($whereClause as $part) {
                    if ($part[0] === '=') {
                        $fullWhere[] = $this->formatWhere($part[1], $operator);
                    } else {
                        $q = sprintf(
                            '%s %s',
                            $this->quoteIdentifier($part[1]),
                            $part[0]
                        );

                        if (isset($part[2])) {
                            $q .= ' ' . $this->quote($part[2]);
                        }

                        $fullWhere[] = $q;
                    }
                }
            }
        }

        return '(' . implode(" {$operator} ", $fullWhere) . ')';
    }