Right Join Tables

@param   string  $table  Table name
@param   string  $field1  Table.Fieldname
@param   string  $operator Operator
@param   string  $field2  Table.Fieldname

@example rightJoin('users', 'users.id', '=', 'login.id')
502360
public function rightJoin($table, $field1, $operator, $field2) {
        array_push($this->_joins, ' RIGHT JOIN ' . $table . ' ON ' . $field1 . ' ' . $operator . ' ' . $field2 . ' ');
    
        return $this;
    }
707551
public function rightJoin($trueTableName, $alias, $on) {
        $join = new Join($trueTableName, $alias, $on);
        $join->setType(Join::RIGHT_JOIN);

        $this->statementContext->getJoinClause()->addJoin($join);
        return $this;
    }
820987
public function addInnerJoinUsing($table, $where)
    {
        //argument test
        Argument::i()
            //Argument 1 must be a string
            ->test(1, 'string')
            //Argument 2 must be a string
            ->test(2, 'string');
        
        $where = func_get_args();
        $table = array_shift($where);
        
        $this->join[] = array(self::INNER, $table, $where, true);
        
        return $this;
    }
1107681
public function join($table)
    {
        if( !empty($this->currentJoin) ) {
            $this->joins[] = $this->currentJoin;
        }
        $this->currentJoin = array();
        $this->currentJoin['table'] = $table;
        $this->currentJoin['direction'] = 'INNER';
        return $this;
    }
817710
public function on($column1, $column2 = null, $operator = '=')
    {
        return $this->addJoinCondition($column1, $column2, $operator);
    }
229854
public function rightJoinOnTo($source, $table, $on)
    {
        $instance = $this->joinStrategyInstance();

        $instance->joinStrategy()->rightJoinOnTo($source, $table, $on);

        return $instance;
    }
63601
public function setFieldOperator(string $field, string $operator = self::OPERATOR_OR): self
    {
        return $this->setFieldParam($field, 'operator', $operator);
    }
878286
public function crossJoin( $table, $first = null, $operator = null, $second = null )
	{
		if ( $first )
		{
			return $this->join( $table, $first, $operator, $second, 'cross' );
		}

		$this->joins[] = new JoinClause( 'cross', $table );

		return $this;
	}
1159783
public function leftJoinWhere($table, $first, $operator, $second)
    {
        return $this->joinWhere($table, $first, $operator, $second, 'left');
    }
742637
public function join(string $table, string $leftField, string $comparison, $rightField): self
    {
        $this->join[] = ['inner', $table, $leftField, $comparison, $rightField];

        return $this;
    }
1251939
public function orOn($column1, $column2 = null, $operator = '=')
    {
        return $this->addJoinCondition($column1, $column2, $operator, 'OR');
    }
406711
public function leftJoin($table, $field1, $operator, $field2) {
        array_push($this->_joins, ' LEFT JOIN ' . $table . ' ON ' . $field1 . ' ' . $operator . ' ' . $field2 . ' ');
    
        return $this;
    }
993472
public function where($val1, $val2 = null, string $operator = null, bool $bind = null, string $join = null){
		$operator = $operator !== null ? strtoupper(trim($operator)) : '=';
		$bind     = $bind ?? true;

		$join = strtoupper(trim($join));
		$join = in_array($join, $this->joinArgs, true) ? $join : 'AND';

		if(in_array($operator, $this->operators, true)){
			$where = [
				is_array($val1)
					? strtoupper($val1[1]).'('.$this->dialect->quote($val1[0]).')'
					: $this->dialect->quote($val1)
			];

			if(in_array($operator, ['IN', 'NOT IN', 'ANY', 'SOME',], true)){

				if(is_array($val2)){

					if($bind){
						$where[] = $operator.'('.implode(',', array_fill(0, count($val2), '?')).')';
						$this->bindValues = array_merge($this->bindValues, $val2);
					}
					else{
						$where[] = $operator.'('.implode(',', array_map([$this->db, 'escape'], $val2)).')'; // @todo: quote
					}

				}
				else if($val2 instanceof Statement){
					$where[] = $operator.'('.$val2->sql().')';
					$this->bindValues = array_merge($this->bindValues, $val2->bindValues());
				}

			}
//			else if(in_array($operator, ['BETWEEN', 'NOT BETWEEN'], true)){
				// @todo
//			}
			else{
				$where[] = $operator;

				if($val2 instanceof Statement){
					$where[] = '('.$val2->sql().')';
					$this->bindValues = array_merge($this->bindValues, $val2->bindValues());
				}
				elseif(is_null($val2)){
					$where[] = 'NULL';
				}
				elseif(is_bool($val2)){
					$where[] = $val2 ? 'TRUE' : 'FALSE';
				}
				elseif(in_array(strtolower($val2), ['null', 'false', 'true', 'unknown'], true)){
					$where[] = strtoupper($val2);
				}
				else {

					if($bind){
						$where[] = '?';
						$this->bindValues[] = $val2;
					}
					else{
						if(!empty($val2)){
							$where[] = $val2;
						}
					}

				}

			}

			$this->where[] = [
				'join' => $join,
				'stmt' => implode(' ', $where),
			];

		}

		return $this;
	}
170867
private function join($type, $table, $col, $op, $col2 = '')
    {
        $col = $this->formatColumn($col);
        $col2 = $this->formatColumn($col2);
        $this->_sql['join'][$type][] = [$table, $col, $op, $col2];
        return $this;
    }
1153247
public static function first($table, $field, $condition)
    {
        $db = self::Using(self::$using_dbo_id);
        return $db->resultFirst($table, $field, $condition);
    }
1112135
public function right_outer_join($table, $constraint, $table_alias = null)
        {
            return $this->_addJoinSource("RIGHT OUTER", $table, $constraint, $table_alias);
        }
1155817
public function fullJoin($table, $leftKey, $rightKey)
	{
		$this->syntax->setJoin($table, $leftKey, $rightKey, 'full');
		return $this;
	}