public function Connection::tablePrefix

Find the prefix for a table.

This function is for when you want to know the prefix of a table. This is not used in prefixTables due to performance reasons.

File

drupal/core/lib/Drupal/Core/Database/Connection.php, line 314
Definition of Drupal\Core\Database\Connection

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

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