Empties a query clause of current values

@param   string  $clause  [select, update, insert, delete, from, join, set, values, where, group, having, order]
@return  $this
@since   2.2.15
338273
public function clear($clause = '')
	{
		if (!$clause)
		{
			$this->reset();
		}
		else
		{
			$clause = 'reset' . ucfirst(strtolower($clause));

			$this->syntax->$clause();
		}

		return $this;
	}
181544
public function delete(Query $query)
    {
        $options = $query->getOptions();
        $where   = $this->parseWhere($query, $options['where']);

        $bulk = new BulkWrite;

        if (1 == $options['limit']) {
            $deleteOptions = ['limit' => 1];
        } else {
            $deleteOptions = ['limit' => 0];
        }

        $bulk->delete($where, $deleteOptions);

        $this->log('remove', $where, $deleteOptions);

        return $bulk;
    }
556881
public function filter($predicate)
    {
        $this->iterator = Iterators::filter($this->iterator, $predicate);
        return $this;
    }
1374598
protected function emptyQuery() {
        $q                 = new Query();
        $q->resultSets     = [];
        $q->resultSet      = [];
        $q->performed      = true;
        $q->countperformed = true;

        return $q;
    }
370042
public function clear($clause=null)
  {
    switch($clause){
      case 'select':
        $this->select = null;
        $this->type   = null;
        break;

      case 'delete':
        $this->delete = null;
        $this->type   = null;
        break;

      case 'update':
        $this->update = null;
        $this->type   = null;
        break;

      case 'insert':
        $this->insert = null;
        $this->type   = null;
        $this->autoIncrementField = null;
        break;

      case 'from':
        $this->from = null;
        break;

      case 'join':
        $this->join = null;
        break;

      case 'set':
        $this->set = null;
        break;

      case 'where':
        $this->where = null;
        break;

      case 'group':
        $this->group = null;
        break;

      case 'having':
        $this->having = null;
        break;

      case 'order':
        $this->order = null;
        break;

      case 'columns':
        $this->columns = null;
        break;

      case 'values':
        $this->values = null;
        break;

      default:
        $this->type               = null;
        $this->select             = null;
        $this->delete             = null;
        $this->update             = null;
        $this->insert             = null;
        $this->from               = null;
        $this->join               = null;
        $this->set                = null;
        $this->where              = null;
        $this->group              = null;
        $this->having             = null;
        $this->order              = null;
        $this->columns            = null;
        $this->values             = null;
        $this->autoIncrementField = null;
        break;
    }

    return $this;
  }
1374911
public function setQuery($query)
    {
        if (!($query instanceof QueryString)) {
            $this->query = new QueryString($query);

            return $this;
        }

        $this->query = $query;

        return $this;
    }
309017
public function whereExpr($expr, $bind = null)
    {
        foreach ($this->queries as $query) {
            $query->whereExpr($expr, $bind);
        }

        return $this;
    }
76074
public function delete(string $variable, bool $detach = false): self
    {
        $query = new self;
        $query->clauses = $this->clauses->add(
            new Clause\DeleteClause($variable, $detach)
        );

        return $query;
    }
399061
public function setQuery($query, $isClean = false){
    if((!empty($query))&&is_string($query)){
      $query = DdvUrl::parseQuery($query);
    }
    if ($isClean !==false) {
      $this->query = array();
    }
    $this->query = array_merge($this->query, $query);
    return $this;
  }
355897
static public function clause(/* parameterized list of Clause\Base objects */)
    {
        $objClauseArray = array();

        foreach (func_get_args() as $objClause) {
            if ($objClause) {
                if (!($objClause instanceof Clause\ClauseInterface)) {
                    throw new Caller('Non-Clause object was passed in to QQ::Clause');
                } else {
                    array_push($objClauseArray, $objClause);
                }
            }
        }

        return $objClauseArray;
    }
986223
public function del($filter) {
		$query = $this->newDelete();
		if ($filter !== true) {
			if (is_string($filter) || is_numeric($filter)) {
				$query->where(field($this->_primary_key)->eq($filter));
			} elseif (!is_array($filter) || count($filter) === 0) {
				throw new DBException("Filter can not be empty");
			} else {
				foreach ($filter as $k => $v) {
					$query->andWhere(field($k)->eq($v));
				}
			}
		}
		return $this->execute($query);
	}
1344348
public function setQuery($query)
    {
        $this->query = $query;
        parse_str($this->query, $this->query_array);
        return $this;
    }
1290358
public function join(Clause\Join $clause)
    {
        if (is_array($clause)) {
            $this->join = array_merge($this->join[], array_values($clause));
        } else {
            $this->join[] = $clause;
        }

        return $this;
    }
167774
public function queriedDelete(Query $query)
    {
        if ($query->getLimit()
            || $query->getSort()
            || ($query instanceof RqlQuery && $query->getGroupBy())
            || $query->getSelect()) {
            throw new InvalidArgumentException('Only where clause allowed for delete');
        }

        $conditionBuilder = new SqlConditionBuilder(
            $this->getDbTable()->getAdapter(),
            $this->getDbTable()->getTable()
        );

        $sql = new Sql($this->getDbTable()->getAdapter());
        $delete = $sql->delete($this->getDbTable()->getTable());
        $delete->where($conditionBuilder->__invoke($query->getQuery()));
        $sqlString = $sql->buildSqlString($delete);

        $adapter = $this->dbTable->getAdapter();
        $shouldDeletedIds = array_map(function ($item) {
            return $item[$this->getIdentifier()];
        }, $this->query($query));

        try {
            $statement = $adapter->getDriver()->createStatement($sqlString);
            $result = $statement->execute();
        } catch (\Throwable $e) {
            throw new DataStoreException("Can't delete records using query", 0, $e);
        }

        if (count($shouldDeletedIds) === $result->getAffectedRows()) {
            return $shouldDeletedIds;
        } else {
            $result = $this->query($query);

            foreach ($result as $record) {
                if (in_array($record[$this->getIdentifier()], $shouldDeletedIds)) {
                    unset($shouldDeletedIds[$record[$this->getIdentifier()]]);
                }
            }
        }

        return $shouldDeletedIds;
    }
814242
def add_clause(self, clause):
        
        if clause.query_loc == MongoClause.LOC_MAIN:
            self._main.append(clause)
        elif clause.query_loc == MongoClause.LOC_MAIN2:
            self._main2.append(clause)
        elif clause.query_loc == MongoClause.LOC_WHERE:
            self._where.append(clause)
        else:
            raise RuntimeError('bad clause location: {}'.format(clause.query_loc))
326081
public function append($query): self
    {
        if ($query instanceof UriComponentInterface) {
            $query = $query->getContent();
        }

        $pairs = array_merge($this->pairs, QueryString::parse($query, $this->separator, PHP_QUERY_RFC3986));
        if ($pairs === $this->pairs) {
            return $this;
        }

        $clone = clone $this;
        $clone->pairs = array_filter($pairs, [$this, 'filterEmptyValue']);

        return $clone;
    }
881121
protected function compileDeleteWithJoins($query, $table)
    {
        $using = ' USING '.collect($query->joins)->map(function ($join) {
            return $this->wrapTable($join->table);
        })->implode(', ');

        $where = count($query->wheres) > 0 ? ' '.$this->compileUpdateWheres($query) : '';

        return trim("delete from {$table}{$using}{$where}");
    }