You are here

public function Connection::tablePrefix in Drupal driver for SQL Server and SQL Azure 3.0.x

Adding logic for temporary tables.

Overrides Connection::tablePrefix

1 call to Connection::tablePrefix()
Connection::getFullQualifiedTableName in drivers/lib/Drupal/Driver/Database/sqlsrv/Connection.php
Including schema name.

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Connection.php, line 771

Class

Connection
Sqlsvr implementation of \Drupal\Core\Database\Connection.

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function tablePrefix($table = 'default') {
  if (isset($this->prefixes[$table])) {
    return $this->prefixes[$table];
  }
  $temp_prefix = '';
  if ($this
    ->isTemporaryTable($table)) {
    $temp_prefix = $this->tempTablePrefix;

    // If there is a period in the prefix, apply the temp prefix to the final
    // piece.
    $default_parts = explode('.', $this->prefixes['default']);
    $table_part = array_pop($default_parts);
    $default_parts[] = $this->tempTablePrefix . $table_part;
    return implode('.', $default_parts);
  }
  return $this->prefixes['default'];
}