Append an OR Criterion onto this Criterion's list.

@param Criterion $criterion

@return Criterion
437324
public function addOr(Criterion $criterion)
    {
        $this->clauses[] = $criterion;
        $this->conjunctions[] = self::ODER;

        return $this;
    }
329431
public function any(array $criteria) : self
    {
        $sql = [];
        $par = [];
        foreach ($criteria as $row) {
            if (isset($row[1])) {
                $temp = $this->filterSQL($row[0], $row[1] ?? null, $row[2] ?? false);
                $sql[] = $temp[0];
                $par = array_merge($par, $temp[1]);
            }
        }
        return $this->where('(' . implode(' OR ', $sql) . ')', $par);
    }
73398
public function canVisit(Criterion $criterion)
    {
        return
            $criterion instanceof Criterion\Location\IsMainLocation && $criterion->operator === Operator::EQ;
    }
1232229
private static function createAdGroupCriterionOperation(
        AdGroupCriterion $criterion,
        $operator
    ) {
        $operation = new AdGroupCriterionOperation();
        $operation->setOperand($criterion);
        $operation->setOperator($operator);

        return $operation;
    }
924407
private function buildIsMainLocation(CriterionDefinition $definition)
    {
        if (null === $definition->value) {
            return null;
        }

        $isMainLocation = $definition->value ? IsMainLocation::MAIN : IsMainLocation::NOT_MAIN;

        return new IsMainLocation($isMainLocation);
    }
134640
public function canVisit(Criterion $criterion)
    {
        return
            $criterion instanceof SectionIdentifierCriterion
            && (
                ($criterion->operator ?: Operator::IN) === Operator::IN ||
                $criterion->operator === Operator::EQ
            );
    }
685818
public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null)
    {
        $fieldNames = $this->getFieldNames($criterion);

        if (empty($fieldNames)) {
            throw new InvalidArgumentException(
                '$criterion->target',
                "No searchable fields found for the given criterion target '{$criterion->target}'."
            );
        }

        $queries = [];

        foreach ($fieldNames as $fieldName) {
            $match = $criterion->value[0] === IsFieldEmptyCriterion::IS_EMPTY ? 'true' : 'false';
            $queries[] = "{$fieldName}:{$match}";
        }

        return '(' . implode(' OR ', $queries) . ')';
    }
1316385
public void addOrCriteria(Criteria pc)
    {
        if (!m_criteria.isEmpty())
        {
            pc.setEmbraced(true);
            pc.setType(OR);
            addCriteria(pc);
        }
        else
        {
            setEmbraced(false);
            pc.setType(OR);
            addCriteria(pc);
        }
    }
136265
public function buildCriteria()
    {
        $criteria = new Criteria(C2MTableMap::DATABASE_NAME);

        if ($this->isColumnModified(C2MTableMap::COL_CATEGORY_ID)) {
            $criteria->add(C2MTableMap::COL_CATEGORY_ID, $this->category_id);
        }
        if ($this->isColumnModified(C2MTableMap::COL_MEDIA_ID)) {
            $criteria->add(C2MTableMap::COL_MEDIA_ID, $this->media_id);
        }

        return $criteria;
    }
384778
public function canVisit(Criterion $criterion)
    {
        return $criterion instanceof Criterion\Visibility && $criterion->operator === Operator::EQ;
    }
306894
protected function getCondition(Criterion $criterion)
    {
        $terms = array();
        $values = (array)$criterion->value;

        foreach ($values as $value) {
            $terms[] = array(
                'match' => array(
                    'fields_doc.' . $criterion->target => array(
                        'query' => $value,
                    ),
                ),
            );
        }

        return $terms;
    }
939727
public function transformCriterionGroup(CriterionGroupInterface $criterionGroup)
    {
        $criterionCount = $criterionGroup->count();
        $subQuery = [];

        if ($criterionCount === 1) {
            // Handle simple criterion
            $criterion = $criterionGroup->getCriteria();
            /** @var CriterionInterface $criterionGroup */
            $criterion = array_pop($criterion)[0];

            $subQuery["filtered"] = $this->transformCriterion($criterion);
        } else {
            //Handle multiple criteria

            // 1st, split OR groups
            // This must be transformed with operator priority: AND is prior to OR.

            $splitConditions = [];
            $i = 0;

            foreach ($criterionGroup->getCriteria() as $criterionTuple) {
                /** @var CriterionInterface $criterion */
                list($criterion, $link) = $criterionTuple;
                $splitConditions[$i][] = $criterion;

                if ($link === Link::LINK_OR) {
                    $i++;
                }
            }

            if (count($splitConditions) === 1) {
                // Group without OR
                $subQuery["filtered"] = [
                    "filter" => [],
                ];

                $keyBag = [];

                /** @var CriterionInterface $criterion */
                foreach ($splitConditions[0] as $criterion) {
                    $subQuery["filtered"] = array_merge_recursive(
                        $subQuery["filtered"],
                        $this->transformCriterion($criterion, $keyBag)
                    );
                }
            } else {
                // Group with OR
                $subQueries = [];

                foreach ($splitConditions as $splitCondition) {
                    $keyBag = [];

                    $subQuery["filtered"] = [
                        "filter" => [],
                    ];

                    /** @var CriterionInterface $criterion */
                    foreach ($splitCondition as $criterion) {
                        $subQuery["filtered"] = array_merge_recursive(
                            $subQuery["filtered"],
                            $this->transformCriterion($criterion, $keyBag)
                        );
                    }

                    $subQueries[]["query"] = $subQuery;
                }

                $subQuery = ["filtered" => ["filter" => ["or" => $subQueries]]];
            }
        }

        return $subQuery;
    }
402850
public function orWhere($field)
    {
        if ($field instanceof Criteria) {
            return $this->root->inject(Node::OPERATOR_OR, $field->root)->getMostRecentCriteria();
        }

        return $this->root->append(Node::OPERATOR_OR, new Criteria($field, $this->root))->getMostRecentCriteria();
    }
1107702
public function add(CriterionInterface $criterion): self
    {
        if (! $criterion->isAttached()) {
            $criterion->attach($this);
        }

        $this->criteria[] = $criterion;

        return $this;
    }
41556
public function outerJoin($table, ...$criterion): self
    {
        $this->join[] = $this->joinArgumentsToJoinObject('OUTER', $table, $criterion);
        return $this;
    }
713338
public function buildCriteria()
    {
        $criteria = new Criteria(PersonFunctionTableMap::DATABASE_NAME);

        if ($this->isColumnModified(PersonFunctionTableMap::ID)) $criteria->add(PersonFunctionTableMap::ID, $this->id);
        if ($this->isColumnModified(PersonFunctionTableMap::CODE)) $criteria->add(PersonFunctionTableMap::CODE, $this->code);
        if ($this->isColumnModified(PersonFunctionTableMap::CREATED_AT)) $criteria->add(PersonFunctionTableMap::CREATED_AT, $this->created_at);
        if ($this->isColumnModified(PersonFunctionTableMap::UPDATED_AT)) $criteria->add(PersonFunctionTableMap::UPDATED_AT, $this->updated_at);

        return $criteria;
    }
640940
public function buildCriteria()
    {
        $criteria = new Criteria(RecordTableMap::DATABASE_NAME);

        if ($this->isColumnModified(RecordTableMap::COL_ID)) {
            $criteria->add(RecordTableMap::COL_ID, $this->id);
        }
        if ($this->isColumnModified(RecordTableMap::COL_MAPUID)) {
            $criteria->add(RecordTableMap::COL_MAPUID, $this->mapuid);
        }
        if ($this->isColumnModified(RecordTableMap::COL_NBLAPS)) {
            $criteria->add(RecordTableMap::COL_NBLAPS, $this->nblaps);
        }
        if ($this->isColumnModified(RecordTableMap::COL_SCORE)) {
            $criteria->add(RecordTableMap::COL_SCORE, $this->score);
        }
        if ($this->isColumnModified(RecordTableMap::COL_NBFINISH)) {
            $criteria->add(RecordTableMap::COL_NBFINISH, $this->nbfinish);
        }
        if ($this->isColumnModified(RecordTableMap::COL_AVGSCORE)) {
            $criteria->add(RecordTableMap::COL_AVGSCORE, $this->avgscore);
        }
        if ($this->isColumnModified(RecordTableMap::COL_CHECKPOINTS)) {
            $criteria->add(RecordTableMap::COL_CHECKPOINTS, $this->checkpoints);
        }
        if ($this->isColumnModified(RecordTableMap::COL_PLAYER_ID)) {
            $criteria->add(RecordTableMap::COL_PLAYER_ID, $this->player_id);
        }
        if ($this->isColumnModified(RecordTableMap::COL_CREATED_AT)) {
            $criteria->add(RecordTableMap::COL_CREATED_AT, $this->created_at);
        }
        if ($this->isColumnModified(RecordTableMap::COL_UPDATED_AT)) {
            $criteria->add(RecordTableMap::COL_UPDATED_AT, $this->updated_at);
        }

        return $criteria;
    }