framework/db/mssql/Schema.php
protected function resolveTableNames($table, $name)
    {
        $parts = explode('.', str_replace(['[', ']'], '', $name));
        $partCount = count($parts);
        if ($partCount === 4) {
            // server name, catalog name, schema name and table name passed
            $table->catalogName = $parts[1];
            $table->schemaName = $parts[2];
            $table->name = $parts[3];
            $table->fullName = $table->catalogName . '.' . $table->schemaName . '.' . $table->name;
        } elseif ($partCount === 3) {
            // catalog name, schema name and table name passed
            $table->catalogName = $parts[0];
            $table->schemaName = $parts[1];
            $table->name = $parts[2];
            $table->fullName = $table->catalogName . '.' . $table->schemaName . '.' . $table->name;
        } elseif ($partCount === 2) {
            // only schema name and table name passed
            $table->schemaName = $parts[0];
            $table->name = $parts[1];
            $table->fullName = $table->schemaName !== $this->defaultSchema ? $table->schemaName . '.' . $table->name : $table->name;
        } else {
            // only table name passed
            $table->schemaName = $this->defaultSchema;
            $table->fullName = $table->name = $parts[0];
        }
    }
protected function resolveTableNames($table, $name)
    {
        $parts = explode('.', str_replace(['[', ']'], '', $name));
        $partCount = count($parts);
        if ($partCount === 4) {
            // server name, catalog name, schema name and table name passed
            $table->catalogName = $parts[1];
            $table->schemaName = $parts[2];
            $table->name = $parts[3];
            $table->fullName = $table->catalogName . '.' . $table->schemaName . '.' . $table->name;
        } elseif ($partCount === 3) {
            // catalog name, schema name and table name passed
            $table->catalogName = $parts[0];
            $table->schemaName = $parts[1];
            $table->name = $parts[2];
            $table->fullName = $table->catalogName . '.' . $table->schemaName . '.' . $table->name;
        } elseif ($partCount === 2) {
            // only schema name and table name passed
            $table->schemaName = $parts[0];
            $table->name = $parts[1];
            $table->fullName = $table->schemaName !== $this->defaultSchema ? $table->schemaName . '.' . $table->name : $table->name;
        } else {
            // only table name passed
            $table->schemaName = $this->defaultSchema;
            $table->fullName = $table->name = $parts[0];
        }
    }
protected function resolveTableNames ( $ table , $ name ) { $ parts = explode ( '.' , str_replace ( [ '[' , ']' ] , '' , $ name ) ) ; $ partCount = count ( $ parts ) ; if ( $ partCount === 4 ) { // server name, catalog name, schema name and table name passed $ table -> catalogName = $ parts [ 1 ] ; $ table -> schemaName = $ parts [ 2 ] ; $ table -> name = $ parts [ 3 ] ; $ table -> fullName = $ table -> catalogName . '.' . $ table -> schemaName . '.' . $ table -> name ; } elseif ( $ partCount === 3 ) { // catalog name, schema name and table name passed $ table -> catalogName = $ parts [ 0 ] ; $ table -> schemaName = $ parts [ 1 ] ; $ table -> name = $ parts [ 2 ] ; $ table -> fullName = $ table -> catalogName . '.' . $ table -> schemaName . '.' . $ table -> name ; } elseif ( $ partCount === 2 ) { // only schema name and table name passed $ table -> schemaName = $ parts [ 0 ] ; $ table -> name = $ parts [ 1 ] ; $ table -> fullName = $ table -> schemaName !== $ this -> defaultSchema ? $ table -> schemaName . '.' . $ table -> name : $ table -> name ; } else { // only table name passed $ table -> schemaName = $ this -> defaultSchema ; $ table -> fullName = $ table -> name = $ parts [ 0 ] ; } }
Resolves the table name and schema name (if any).
@param TableSchema $table the table metadata object
@param string $name the table name
Resolves the table name and schema name ( if any ) .