protected function joinArgumentsToJoinObject(string $type, $table, array $criterion = []): Join
    {
        if (is_array($table)) {
            $tableName = $table[0] ?? null;
            $tableAlias = $table[1] ?? null;
        } else {
            $tableName = $table;
            $tableAlias = null;
        }

        $tableName = $this->checkStringValue('Argument $tableName', $tableName);
        if ($tableAlias !== null && !is_string($tableAlias)) {
            return $this->handleException(InvalidArgumentException::create(
                'Argument $tableAlias',
                $tableAlias,
                ['string', 'null']
            ));
        }

        if ($criterion) {
            $criterion = $this->whereArgumentsToCriterion($criterion, 'AND', true);
            $criteria = ($criterion instanceof CriteriaCriterion && !$criterion->not)
                ? $criterion->criteria
                : [$criterion];
        } else {
            $criteria = [];
        }

        return new Join($type, $tableName, $tableAlias, $criteria);
    }
protected function joinArgumentsToJoinObject(string $type, $table, array $criterion = []): Join
    {
        if (is_array($table)) {
            $tableName = $table[0] ?? null;
            $tableAlias = $table[1] ?? null;
        } else {
            $tableName = $table;
            $tableAlias = null;
        }

        $tableName = $this->checkStringValue('Argument $tableName', $tableName);
        if ($tableAlias !== null && !is_string($tableAlias)) {
            return $this->handleException(InvalidArgumentException::create(
                'Argument $tableAlias',
                $tableAlias,
                ['string', 'null']
            ));
        }

        if ($criterion) {
            $criterion = $this->whereArgumentsToCriterion($criterion, 'AND', true);
            $criteria = ($criterion instanceof CriteriaCriterion && !$criterion->not)
                ? $criterion->criteria
                : [$criterion];
        } else {
            $criteria = [];
        }

        return new Join($type, $tableName, $tableAlias, $criteria);
    }
protected function joinArgumentsToJoinObject ( string $ type , $ table , array $ criterion = [ ] ) : Join { if ( is_array ( $ table ) ) { $ tableName = $ table [ 0 ] ?? null ; $ tableAlias = $ table [ 1 ] ?? null ; } else { $ tableName = $ table ; $ tableAlias = null ; } $ tableName = $ this -> checkStringValue ( 'Argument $tableName' , $ tableName ) ; if ( $ tableAlias !== null && ! is_string ( $ tableAlias ) ) { return $ this -> handleException ( InvalidArgumentException :: create ( 'Argument $tableAlias' , $ tableAlias , [ 'string' , 'null' ] ) ) ; } if ( $ criterion ) { $ criterion = $ this -> whereArgumentsToCriterion ( $ criterion , 'AND' , true ) ; $ criteria = ( $ criterion instanceof CriteriaCriterion && ! $ criterion -> not ) ? $ criterion -> criteria : [ $ criterion ] ; } else { $ criteria = [ ] ; } return new Join ( $ type , $ tableName , $ tableAlias , $ criteria ) ; }
Converts `join` method arguments to a join object

@see innerJoin The arguments format
@params string $type The join type (INNER, LEFT, etc.)
@params mixed $table The joined table
@params array The join criterion arguments
@return Join
@throws InvalidArgumentException
@throws InvalidReturnValueException
Converts join method arguments to a join object