Skip to content
Snippets Groups Projects

deprecating Drupal\Core\Database\Connection::prefixTable(table)

4 unresolved threads
Files
11
@@ -365,6 +365,15 @@ public function getConnectionOptions() {
@@ -365,6 +365,15 @@ public function getConnectionOptions() {
public function attachDatabase(string $database): void {
public function attachDatabase(string $database): void {
}
}
 
/**
 
* Returns the prefix of the tables.
 
*
 
* @return string $prefix
 
*/
 
public function getPrefix(): string {
 
return $this->prefix;
 
}
 
/**
/**
* Set the prefix used by this database connection.
* Set the prefix used by this database connection.
*
*
@@ -430,8 +439,14 @@ public function quoteIdentifiers($sql) {
@@ -430,8 +439,14 @@ public function quoteIdentifiers($sql) {
*
*
* @param string $table
* @param string $table
* (optional) The table to find the prefix for.
* (optional) The table to find the prefix for.
 
*
 
* @deprecated in drupal:10.1.0 and is removed from drupal:11.0.0.
 
* Instead, you should just use Connection::getPrefix().
 
*
 
* @see https://www.drupal.org/node/3260849
*/
*/
public function tablePrefix($table = 'default') {
public function tablePrefix($table = 'default') {
 
@trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Instead, you should just use Connection::getPrefix(). See https://www.drupal.org/node/3260849', E_USER_DEPRECATED);
return $this->prefix;
return $this->prefix;
}
}
@@ -462,7 +477,7 @@ public function getUnprefixedTablesMap() {
@@ -462,7 +477,7 @@ public function getUnprefixedTablesMap() {
*/
*/
public function getFullQualifiedTableName($table) {
public function getFullQualifiedTableName($table) {
$options = $this->getConnectionOptions();
$options = $this->getConnectionOptions();
$prefix = $this->tablePrefix($table);
$prefix = $this->getPrefix();
return $options['database'] . '.' . $prefix . $table;
return $options['database'] . '.' . $prefix . $table;
}
}
Loading