Add conditions to grid model.

@param array $conditions

@return $this
498857
public function addConditions(array $conditions)
    {
        foreach ($conditions as $condition) {
            call_user_func_array([$this, key($condition)], current($condition));
        }

        return $this;
    }
1208833
public function having($conditions): self
    {
        if ($conditions[0] instanceof Closure) {
            $this->addClauseCondClosure('having', 'AND', $conditions[0]);

            return $this;
        }
        $this->having[] = ['and', $conditions];

        return $this;
    }
303296
public function andWhere(string ...$condition) : self
    {
        $this->whereConditions = $this->addConditionToClause(
            $this->whereConditions, 'AND', ...$condition);

        return $this;
    }
154108
protected function addConditions($query, $conditions)
    {
        foreach ($conditions as $key => $value) {
            $this->addWhere($query, $key, $value);
        }

        return $query;
    }
935452
public function addCondition(ConditionAbstract $condition)
    {
        if ($condition instanceof SupportsCondition) {
            $this->conditions[] = $condition;
        } else {
            throw new \InvalidArgumentException(
                "Invalid condition instance. Instance of 'SupportsCondition' expected."
            );
        }

        return $this;
    }
1155870
protected function prepareArray(array $conditions)
    {
        switch (count($conditions)) {
            case 1:
                $result = $conditions[0];
                break;
            case 2:
                if (is_array($conditions[1])) {
                    $result = $conditions[0].' IN ('.implode(',', $conditions[1]).')';
                } elseif (is_null($conditions[1])) {
                    $result = $conditions[0].' IS NULL';
                } elseif ($conditions[1] instanceof \pwf\components\querybuilder\interfaces\SelectBuilder) {
                    $result = $conditions[0].' IN ('.$conditions[1]->generate().')';
                    $this->setParams(array_merge($this->getParams(),
                            $conditions[1]->getParams()));
                } else {
                    $result = $conditions[0].'=?';//.$conditions[0];
                    $this->addParam($conditions[0], $conditions[1]);
                }
                break;
            case 3:
                $left   = is_array($conditions[1]) ? $this->prepareConditions($conditions[1])
                        : $conditions[1];
                $right  = is_array($conditions[2]) ? $this->prepareConditions($conditions[2])
                        : $conditions[2];
                $result = '(('.$left.') '.$conditions[0].' ('.$right.'))';
                break;
            default:
                throw new \Exception('Wrong condition configuration');
        }

        return $result;
    }
392388
protected function _createWhere(array $conditions) {
		$where = [];
		foreach ($conditions as $field => $value) {
			$where[] = $field . '=?';
		}
		$where = implode(' AND ', $where);
		if (!empty($where)) $where = 'WHERE ' . $where;
		return $where;
	}
979377
public function filterOne(array $condition)
	{
		foreach ($this->data as $item) {
			foreach ($condition as $key => $value) {
				if ($item[$key] == $value) {
					$this->setData([$item]);

					return $this;
				}
			}
		}

		$this->setData([]);

		return $this;
	}
991887
public function filterOne(array $condition)
	{
		$cond = [];
		foreach ($condition as $key => $value) {
			$cond[$this->prepareColumn($key)] = $value;
		}
		$this->data_source = $this->data_source->findBy($cond);

		return $this;
	}
458676
public function addFilters(array $filters)
    {
        foreach ($filters as $filter) {
            if ($filter instanceof QueryDSL) {
                $this->addFilter($filter);
            }
        }
        return $this;
    }
269757
public function insertIfNotExists(array $sets, array $conditions = [])
    {
        if (count($sets)) {
            if ($result = $this->qb->from($this->table)->getWhere($conditions)) {
                if ($result->count() == 0) {
                    return $this->insert($sets);
                }
            }
        }

        return false;
    }
906111
public function addSets(array $values = array())
    {
        foreach ($values as $column => $value) {
            $this->addSet($column, $value);
        }

        return $this;
    }
1273952
public function addConditions( $conditions )
	{
		if( !is_array( $conditions ) )
			throw new InvalidArgumentException( 'An Array should be given.' );
		foreach( $conditions as $condition )
			$this->addCondition( $condition );
	}
669248
protected function replaceFilterFunctions(array $conditions)
    {

        foreach ($conditions as $key => $condition) {

            if (is_string($condition)) {
                $conditions[$key] = $this->filters[$condition];
            }

        }

        return $conditions;

    }
704435
public function andIn(string $condition, array $values): self
    {
        return $this->andWith($this->unpackCondition($condition, \count($values)), ...$values);
    }
1151609
public function when($condition, $fields)
    {
        $this->getChildren()->mergeSchema([
            $this->normalizeCondition($condition) => $fields,
        ]);

        return $this;
    }
1367369
public function having(...$conditions) : self
    {
        // We want to wipe out anything already in the condition list
        $this->havingConditions = [];
        $this->havingConditions = $this->conditionalQueryBuilder->addConditionToClause(
            $this->havingConditions, 'AND', ...$this->createConditionExpressions($conditions)
        );

        return $this;
    }