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

        return $resolvedName;
    }
protected function resolveTableName($name)
    {
        $resolvedName = new TableSchema();
        $parts = explode('.', str_replace(['[', ']'], '', $name));
        $partCount = count($parts);
        if ($partCount === 4) {
            // server name, catalog name, schema name and table name passed
            $resolvedName->catalogName = $parts[1];
            $resolvedName->schemaName = $parts[2];
            $resolvedName->name = $parts[3];
            $resolvedName->fullName = $resolvedName->catalogName . '.' . $resolvedName->schemaName . '.' . $resolvedName->name;
        } elseif ($partCount === 3) {
            // catalog name, schema name and table name passed
            $resolvedName->catalogName = $parts[0];
            $resolvedName->schemaName = $parts[1];
            $resolvedName->name = $parts[2];
            $resolvedName->fullName = $resolvedName->catalogName . '.' . $resolvedName->schemaName . '.' . $resolvedName->name;
        } elseif ($partCount === 2) {
            // only schema name and table name passed
            $resolvedName->schemaName = $parts[0];
            $resolvedName->name = $parts[1];
            $resolvedName->fullName = ($resolvedName->schemaName !== $this->defaultSchema ? $resolvedName->schemaName . '.' : '') . $resolvedName->name;
        } else {
            // only table name passed
            $resolvedName->schemaName = $this->defaultSchema;
            $resolvedName->fullName = $resolvedName->name = $parts[0];
        }

        return $resolvedName;
    }
protected function resolveTableName ( $ name ) { $ resolvedName = new TableSchema ( ) ; $ parts = explode ( '.' , str_replace ( [ '[' , ']' ] , '' , $ name ) ) ; $ partCount = count ( $ parts ) ; if ( $ partCount === 4 ) { // server name, catalog name, schema name and table name passed $ resolvedName -> catalogName = $ parts [ 1 ] ; $ resolvedName -> schemaName = $ parts [ 2 ] ; $ resolvedName -> name = $ parts [ 3 ] ; $ resolvedName -> fullName = $ resolvedName -> catalogName . '.' . $ resolvedName -> schemaName . '.' . $ resolvedName -> name ; } elseif ( $ partCount === 3 ) { // catalog name, schema name and table name passed $ resolvedName -> catalogName = $ parts [ 0 ] ; $ resolvedName -> schemaName = $ parts [ 1 ] ; $ resolvedName -> name = $ parts [ 2 ] ; $ resolvedName -> fullName = $ resolvedName -> catalogName . '.' . $ resolvedName -> schemaName . '.' . $ resolvedName -> name ; } elseif ( $ partCount === 2 ) { // only schema name and table name passed $ resolvedName -> schemaName = $ parts [ 0 ] ; $ resolvedName -> name = $ parts [ 1 ] ; $ resolvedName -> fullName = ( $ resolvedName -> schemaName !== $ this -> defaultSchema ? $ resolvedName -> schemaName . '.' : '' ) . $ resolvedName -> name ; } else { // only table name passed $ resolvedName -> schemaName = $ this -> defaultSchema ; $ resolvedName -> fullName = $ resolvedName -> name = $ parts [ 0 ] ; } return $ resolvedName ; }
Resolves the table name and schema name (if any).
@param string $name the table name
@return TableSchema resolved table, schema, etc. names.
Resolves the table name and schema name ( if any ) .