Add an or on condition to the join object

@param string                $localKey
@param string                $operator
@param string                $referenceKey

@return self
548021
public function orOn($localKey, $operator, $referenceKey)
    {
        $this->on($localKey, $operator, $referenceKey, 'or'); return $this;
    }
919554
public function orOn($key, $operator, $value): self
    {
        return $this->on($key, $operator, $value, 'OR');
    }
136607
protected function addRefFKGetJoinMethods(&$script, ForeignKey $refFK)
    {
        $table = $this->getTable();
        $tblFK = $refFK->getTable();
        $join_behavior = $this->getGeneratorConfig()->getBuildProperty('useLeftJoinsInDoJoinMethods') ? 'Criteria::LEFT_JOIN' : 'Criteria::INNER_JOIN';

        $peerClassname = $this->getStubPeerBuilder()->getClassname();
        $relCol = $this->getRefFKPhpNameAffix($refFK, $plural = true);
        $collName = $this->getRefFKCollVarName($refFK);
        $lastCriteriaName = $this->getRefFKLastCriteriaVarName($refFK);

        $fkPeerBuilder = $this->getNewPeerBuilder($tblFK);

        $lastTable = "";
        foreach ($tblFK->getForeignKeys() as $fk2) {

            $tblFK2 = $this->getForeignTable($fk2);
            $doJoinGet = !$tblFK2->isForReferenceOnly();

            // it doesn't make sense to join in rows from the current table, since we are fetching
            // objects related to *this* table (i.e. the joined rows will all be the same row as current object)
            if ($this->getTable()->getPhpName() == $tblFK2->getPhpName()) {
                $doJoinGet = false;
            }

            $relCol2 = $this->getFKPhpNameAffix($fk2, $plural = false);

            if ($this->getRelatedBySuffix($refFK) != "" && ($this->getRelatedBySuffix($refFK) == $this->getRelatedBySuffix($fk2))) {
                $doJoinGet = false;
            }

            if ($doJoinGet) {
                $script .= "

    /**
     * If this collection has already been initialized with
     * an identical criteria, it returns the collection.
     * Otherwise if this " . $table->getPhpName() . " is new, it will return
     * an empty collection; or if this " . $table->getPhpName() . " has previously
     * been saved, it will retrieve related $relCol from storage.
     *
     * This method is protected by default in order to keep the public
     * api reasonable.  You can provide public methods for those you
     * actually need in " . $table->getPhpName() . ".
     */
    public function get" . $relCol . "Join" . $relCol2 . "(\$criteria = null, \$con = null, \$join_behavior = $join_behavior)
    {";
                $script .= "
        if (\$criteria === null) {
            \$criteria = new Criteria($peerClassname::DATABASE_NAME);
        } elseif (\$criteria instanceof Criteria) {
            \$criteria = clone \$criteria;
        }

        if (\$this->$collName === null) {
            if (\$this->isNew()) {
                \$this->$collName = array();
            } else {
";
                foreach ($refFK->getForeignColumns() as $columnName) {
                    $column = $table->getColumn($columnName);
                    $flMap = $refFK->getForeignLocalMapping();
                    $colFKName = $flMap[$columnName];
                    $colFK = $tblFK->getColumn($colFKName);
                    if ($colFK === null) {
                        throw new EngineException("Column $colFKName not found in " . $tblFK->getName());
                    }
                    $clo = strtolower($column->getName());
                    $script .= "
                \$criteria->add(" . $fkPeerBuilder->getColumnConstant($colFK) . ", \$this->$clo);
";
                } // end foreach ($fk->getForeignColumns()

                $script .= "
                \$this->$collName = " . $fkPeerBuilder->getPeerClassname() . "::doSelectJoin$relCol2(\$criteria, \$con, \$join_behavior);
            }
        } else {
            // the following code is to determine if a new query is
            // called for.  If the criteria is the same as the last
            // one, just return the collection.
";
                foreach ($refFK->getForeignColumns() as $columnName) {
                    $column = $table->getColumn($columnName);
                    $flMap = $refFK->getForeignLocalMapping();
                    $colFKName = $flMap[$columnName];
                    $colFK = $tblFK->getColumn($colFKName);
                    $clo = strtolower($column->getName());
                    $script .= "
            \$criteria->add(" . $fkPeerBuilder->getColumnConstant($colFK) . ", \$this->$clo);
";
                } /* end foreach ($fk->getForeignColumns() */

                $script .= "
            if (!isset(\$this->$lastCriteriaName) || !\$this->" . $lastCriteriaName . "->equals(\$criteria)) {
                \$this->$collName = " . $fkPeerBuilder->getPeerClassname() . "::doSelectJoin$relCol2(\$criteria, \$con, \$join_behavior);
            }
        }
        \$this->$lastCriteriaName = \$criteria;

        return \$this->$collName;
    }
";
            } /* end if ($doJoinGet) */
        } /* end foreach ($tblFK->getForeignKeys() as $fk2) { */
    }
546163
public function rightJoin($table, $key, ?string $operator = null, $value = null): IQueryBuilderHandler
    {
        return $this->join($table, $key, $operator, $value, 'right');
    }
264278
public function innerJoin($join, $on = null)
    {
        $this->getJoins()->innerJoin($join, $on);

        return $this;
    }
970929
public function where($key, $operator, $value = null)
    {
        if (func_num_args() == 2) {
            $value = $operator;

            $operator = '=';
        }

        $countries = method_exists($this, 'where'.ucfirst($key))
            ? $this->{'where'.ucfirst($key)}($value)
            : parent::where($key, $operator, $value);

        return $this->hydrateDefaultElements($countries);
    }
68898
public function having($column, $operator = null, $value = null): BaseQueryRelateContract
    {
        $this->query->having($column, $operator, $value, 'and');

        return $this;
    }
320531
public function having($key, $operator, $value, $joiner = 'AND')
    {
        $key = $this->addTablePrefix($key);
        $this->statements['havings'][] = compact('key', 'operator', 'value', 'joiner');
        return $this;
    }
553510
public function join($table, $foreignKey1, $operator, $foreignKey2, $relation = "INNER")
    {
        $self               = self::getInstance();
        $self->optionJoin[] = " {$relation} JOIN {$table} ON {$foreignKey1}{$operator}{$foreignKey2}";
        return $self;
    }
1268270
public function where($key, $operator = null, $value = null)
    {
        return $this->filter($this->operatorForWhere(...func_get_args()));
    }
1231556
public function join(string $table, string $one, string $operator = '=', string $two = ''): BaseQueryRelateContract
    {
        $this->query->join($table, $one, $operator, $two);

        return $this;
    }
718286
protected function operatorForWhere($key, $operator, $value)
    {
        return function ($obj) use ($key, $operator, $value) {
            $retrieved = $obj[$key];

            switch ($operator) {
                default:
                case '=':
                case '==':
                    return $retrieved == $value;
                case '!=':
                case '<>':
                    return $retrieved != $value;
                case '<':
                    return $retrieved < $value;
                case '>':
                    return $retrieved > $value;
                case '<=':
                    return $retrieved <= $value;
                case '>=':
                    return $retrieved >= $value;
                case '===':
                    return $retrieved === $value;
                case '!==':
                    return $retrieved !== $value;
            }
        };
    }
820620
public function where($key, $operator = null, $value = null)
    {
        // If two params are given then assume operator is =
        if (func_num_args() == 2) {
            $value = $operator;
            $operator = '=';
        }
        return $this->whereHandler($key, $operator, $value);
    }
288848
public function join($table, $field1, $operator, $field2) {
        array_push($this->_joins, ' INNER JOIN ' . $table . ' ON ' . $field1 . ' ' . $operator . ' ' . $field2 . ' ');
    
        return $this;
    }
125109
public function relation($column1, $operator, $column2 = null)
    {
        if (func_num_args() < 3) {
            $column2 = $operator;

            $operator = null;
        }

        $this->addRelation('AND', $column1, $operator, $column2);

        return $this;
    }
473552
public function hasMany($related, $parentKey = null, $localKey = null)
    {
        $parentKey = $parentKey ?: $this->getParentKey();
        $localKey = $localKey ?: $this->getKeyName();

        $instance = new $related;

        return new Relations\Relation($instance, $this, $parentKey, $localKey);
    }
395925
public QueryBuilder<T, ID> join(String localColumnName, String joinedColumnName,
			QueryBuilder<?, ?> joinedQueryBuilder, JoinType type, JoinWhereOperation operation) throws SQLException {
		addJoinInfo(type, localColumnName, joinedColumnName, joinedQueryBuilder, operation);
		return this;
	}