add.

@access  public
@param   string  $condition
491010
public function add($condition, array $params = [])
    {
        $this->conditions[] = $condition;
        $this->bind($params);
        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 );
	}
484391
public function where($condition)
    {
        $this->where = ! $this->where ? $condition : $this->where . ' AND ' . $condition;

        return $this;
    }
1252836
public function condition($condition)
    {
        $reference = $this;

        if (count($this->conditions) !== 0) {
            ob_end_clean();
        }

        $reference->saveCondition($condition, ''); /// so above count fires after first pass

        ob_start(function ($data) use ($condition, $reference) {
            $reference->saveCondition($condition, $data);
        });
    }
1351209
public void add(final Condition condition) {
        if (andConditions.isEmpty()) {
            andConditions.add(new AndCondition());
        }
        andConditions.get(0).getConditions().add(condition);
    }
502827
public function setConditions($conditions)
    {
        $this->conditions = [];
        if (!is_array($conditions)) {
            $conditions = [$conditions];
        }
        foreach ($conditions as $condition) {
            $this->addCondition($condition);
        }

        return $this;
    }
1207324
public function add(string $key, $value)
    {
        $current = $this->get($key, []);
        $adds = is_array($value) ? $value : [$value];
        $this->set($key, array_merge($current, array_values($adds)));
    }
600065
public function filter($condition)
    {
        $items = $this->find()->where($condition)->all();
        $this->_filter = $this->_getTreeNodesIds($items);
    }
900392
public function addExpressionCondition($expression) {
        if(!isset($this->_subscription->subject)){
            $this->_subscription->subject = (object) [];
        }

        if(!isset($this->_subscription->subject->condition)){
            $this->_subscription->subject->condition = (object) [];
        }


        $this->_subscription->subject->condition->expression = $expression;
        return $this;
    }
131838
public function andBinaryBody(Condition $condition)
    {
        $this->bodyCondition = new BodyCondition(
            $condition->getMatcher(),
            new BinaryBody($condition->getValue())
        );

        return $this;
    }
993721
public static function basedOn($condition): self
    {
        $name = $condition instanceof Condition ? $condition->name() : $condition;

        return new self($name, '');
    }
910803
public function where(string $condition = '', array $params = []) {
        if ($condition) {
            $this->sql .= " WHERE $condition ";
            $this->params = array_merge($this->params, $params);
        }
        return $this;
    }
741494
public function prependIf($condition, string $prepend)
    {
        if ($this->resolveCondition($condition)) {
            return $this->prepend($prepend);
        }

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

        return $this;
    }
161058
public function addValue($value)
    {
        $this->values = array_values(
            array_unique(
                array_merge($this->values, $this->prepareValues($value))
            )
        );
    }
1139818
protected function _addCondition(array $condition) {
		$conditions = [];
		
		foreach ($condition as $key => $part) {
			if ($key === self::MONGO_OR) {
				if (isset($this->_conditions[self::MONGO_OR]) || isset($this->_conditions[self::MONGO_AND])) {
					// If the "$or" clause already exists, then converts it to the "$and" clause
					if (isset($this->_conditions[self::MONGO_OR])) {
						$mongoAnd = [
							[self::MONGO_OR => $this->_conditions[self::MONGO_OR]],
							[self::MONGO_OR => $part]
						];
						unset($this->_conditions[self::MONGO_OR]);
					}
					// Otherwise, just create the "$and" clause
					else {
						$mongoAnd = [[self::MONGO_OR => $part]];
					}
					
					// If the "$and" clause already exists, then merges it with the last clause
					if (isset($this->_conditions[self::MONGO_AND])) {
						$this->_conditions[self::MONGO_AND] = array_merge(
							$this->_conditions[self::MONGO_AND],
							$mongoAnd
						);
					}
					// Otherwise, put the created clause into the conditions
					else {
						$this->_conditions[self::MONGO_AND] = $mongoAnd;
					}
				} else {
					$conditions[$key] = $part;
				}
			} else {
				$conditions[$key] = $part;
			}
		}
		
		$this->_conditions = $conditions + $this->_conditions;
	}
245332
public function addIf($condition, Item $item)
    {
        if ($this->resolveCondition($condition)) {
            $this->add($item);
        }

        return $this;
    }