@param string $where
@param array  $parameters

@return bool
435087
public function isDataFixtureExists($where, array $parameters = [])
    {
        $entityId = $this->createQueryBuilder('m')
            ->select('m.id')
            ->where($where)
            ->setMaxResults(1)
            ->getQuery()
            ->execute($parameters);

        return $entityId ? true : false;
    }
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());
    }
21644
public function delete(array $where)
    {
        // Current table
        $table = $this->getCollection();

        // Generate where line
        $whereDetails = !empty($where)
            ? ' WHERE ' . $this->genWhere($where)
            : '';

        // Prepare query
        $statement = $this->getInstance()->prepare("DELETE FROM $table $whereDetails");

        // Bind where values
        foreach ($where as $key => $value) {
            $statement->bindValue(":where_$key", $value, $this->isPdoInt($value));
        }

        // Execute operation
        $statement->execute();

        // Return count of affected rows
        return $statement->rowCount();
    }
979744
public function withParameters(array $parameters): self
    {
        $query = $this;

        foreach ($parameters as $key => $parameter) {
            $query = $query->withParameter($key, $parameter);
        }

        return $query;
    }
133843
protected function query($method, $url, array $parameters = null)
    {
        return $this->httpClient->query($method, $url, $parameters);
    }
125062
public function hasWhere($where = [], $fields = null)
    {
        $table    = $this->query->getTable();
        $model    = basename(str_replace('\\', '/', get_class($this->parent)));
        $relation = basename(str_replace('\\', '/', $this->model));

        if (is_array($where)) {
            $this->getQueryWhere($where, $relation);
        }

        $fields = $this->getRelationQueryFields($fields, $model);

        return $this->parent->db()
            ->alias($model)
            ->field($fields)
            ->join($table . ' ' . $relation, $model . '.' . $this->localKey . '=' . $relation . '.' . $this->foreignKey)
            ->where($where);
    }
1079219
private function doWhere($where, $type)
    {

        switch ($type) {

            case 'and':

                $where = $this->useBuilder('where')
                    ->where($where, $this->getCield());

                break;

            case 'or':

                $where = $this->useBuilder('where')
                    ->orWhere($where, $this->getCield());

                break;
        }

        $this->string['where'] = $where['content'];
        $this->string['parameters'] = array_merge($this->string['parameters'], $where['array']);
    }
248989
public function execute($sql, array $parameters = [])
    {
        $sth = $this->prepare($sql);
        $sth->execute($parameters);
        return $sth;
    }
1332294
public function apply($query, array $parameters = [])
    {
        $info = $this->getModelInformation($query->getModel());

        $column = $info && $info->list->active_column ?: 'active';

        return $query->where($column, true);
    }
814862
protected function where(array $where): string
	{
		if(is_array($where['column']))
		{
			$column = '(' . $this->columns($where['column'], false) . ')';

			$value = is_array($where['value']) ? '(' . $this->params($where['value']) . ')' : $this->param($where['value']);

			return $column . ' ' . $where['operator'] . ' ' . $value;
		}

		return $this->column($where['column']) . ' ' . $where['operator'] . ' ' . $this->param($where['value']);
	}
1099322
public function sqlExists(
		$from,
		$where = null,
		array $params = []
	) {
		$sql = $this->queryBuilder->buildExists($from, $where);
		$query = $this->database->prepare($sql);
		$query->execute($params);
		$this->addQuery($query->queryString, $params);
		return (boolean)$query->fetchColumn();
	}
1169978
final protected function wheres(array $wheres, $or = false){
        foreach($wheres as $where => $replace){
            $this->where($where, $replace, $or);
        }
        return $this;
    }
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;
    }
1190550
public function where($where = null)
    {
        if ($where === null) {
            return $this->where;
        }
        $this->where = $where;

        return $this->where;
    }
1217850
public function findWhere($where, $columns = ['*'], $or = false)
    {
        return $this->postProcess( parent::findWhere($where, $columns, $or) );
    }
1301460
public function where($condition, $parameters = [])
	{
		$this->emptyResult();

		$this->queryBuilder->addWhere($condition, $parameters);
		return $this;
	}
488467
protected function formatWhereClause($where)
    {
        if (!empty($where)) {
            if (stripos($where, 'where') === false || stripos($where, 'select') !== false) {
                $where = ' where ' . $where;
            }
        }

        return $where;
    }