Unverified Commit 8a568390 authored by alexpott's avatar alexpott
Browse files

Issue #2947946 by voleger, andypost, mondrake: Create change record for all...

Issue #2947946 by voleger, andypost, mondrake: Create change record for all deprecated db_* functions
parent e08ec139
......@@ -80,16 +80,17 @@ function db_query($query, array $args = [], array $options = []) {
* @return \Drupal\Core\Database\StatementInterface
* A prepared statement object, already executed.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call queryRange() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container
* and call queryRange() on it. For example,
* $injected_database->queryRange($query, $from, $count, $args, $options);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::queryRange()
* @see \Drupal\Core\Database\Connection::defaultOptions()
*/
function db_query_range($query, $from, $count, array $args = [], array $options = []) {
@trigger_error('db_query_range() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call queryRange() on it. For example, $injected_database->queryRange($query, $from, $count, $args, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_query_range() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call queryRange() on it. For example, $injected_database->queryRange($query, $from, $count, $args, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection(_db_get_target($options))->queryRange($query, $from, $count, $args, $options);
}
......@@ -113,16 +114,17 @@ function db_query_range($query, $from, $count, array $args = [], array $options
* @return string
* The name of the temporary table.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call queryTemporary() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container
* and call queryTemporary() on it. For example,
* $injected_database->queryTemporary($query, $args, $options);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::queryTemporary()
* @see \Drupal\Core\Database\Connection::defaultOptions()
*/
function db_query_temporary($query, array $args = [], array $options = []) {
@trigger_error('db_query_temporary() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call queryTemporary() on it. For example, $injected_database->queryTemporary($query, $args, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_query_temporary() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call queryTemporary() on it. For example, $injected_database->queryTemporary($query, $args, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection(_db_get_target($options))->queryTemporary($query, $args, $options);
}
......@@ -142,11 +144,12 @@ function db_query_temporary($query, array $args = [], array $options = []) {
* call insert() on it. For example,
* $injected_database->insert($table, $options);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::insert()
* @see \Drupal\Core\Database\Connection::defaultOptions()
*/
function db_insert($table, array $options = []) {
@trigger_error('db_insert() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call insert() on it. For example, $injected_database->insert($table, $options); See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_insert() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call insert() on it. For example, $injected_database->insert($table, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection(_db_get_target($options, FALSE))->insert($table, $options);
}
......@@ -166,11 +169,12 @@ function db_insert($table, array $options = []) {
* call merge() on it. For example,
* $injected_database->merge($table, $options);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::merge()
* @see \Drupal\Core\Database\Connection::defaultOptions()
*/
function db_merge($table, array $options = []) {
@trigger_error('db_merge() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call merge() on it. For example, $injected_database->merge($table, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_merge() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call merge() on it. For example, $injected_database->merge($table, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection(_db_get_target($options, FALSE))->merge($table, $options);
}
......@@ -190,11 +194,12 @@ function db_merge($table, array $options = []) {
* call update() on it. For example,
* $injected_database->update($table, $options);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::update()
* @see \Drupal\Core\Database\Connection::defaultOptions()
*/
function db_update($table, array $options = []) {
@trigger_error('db_update() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call call update() on it. For example, $injected_database->update($table, $options); See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_update() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call call update() on it. For example, $injected_database->update($table, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection(_db_get_target($options, FALSE))->update($table, $options);
}
......@@ -214,11 +219,12 @@ function db_update($table, array $options = []) {
* call delete() on it. For example,
* $injected_database->delete($table, $options);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::delete()
* @see \Drupal\Core\Database\Connection::defaultOptions()
*/
function db_delete($table, array $options = []) {
@trigger_error('db_delete is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call delete() on it. For example, $injected_database->delete($table, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_delete is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call delete() on it. For example, $injected_database->delete($table, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection(_db_get_target($options, FALSE))->delete($table, $options);
}
......@@ -238,11 +244,12 @@ function db_delete($table, array $options = []) {
* call truncate() on it. For example,
* $injected_database->truncate($table, $options);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::truncate()
* @see \Drupal\Core\Database\Connection::defaultOptions()
*/
function db_truncate($table, array $options = []) {
@trigger_error('db_truncate() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call truncate() on it. For example, $injected_database->truncate($table, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_truncate() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call truncate() on it. For example, $injected_database->truncate($table, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection(_db_get_target($options, FALSE))->truncate($table, $options);
}
......@@ -266,11 +273,12 @@ function db_truncate($table, array $options = []) {
* call select() on it. For example,
* $injected_database->select($table, $alias, $options);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::select()
* @see \Drupal\Core\Database\Connection::defaultOptions()
*/
function db_select($table, $alias = NULL, array $options = []) {
@trigger_error('db_select() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call call select() on it. For example, $injected_database->db_select($table, $alias, $options); See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_select() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call select() on it. For example, $injected_database->db_select($table, $alias, $options). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection(_db_get_target($options))->select($table, $alias, $options);
}
......@@ -286,16 +294,17 @@ function db_select($table, $alias = NULL, array $options = []) {
* @return \Drupal\Core\Database\Transaction
* A new Transaction object for this connection.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* @deprecated in drupal:8.0.x and will be removed from drupal:9.0.0. Instead, get
* a database connection injected into your service from the container and
* call startTransaction() on it. For example,
* $injected_database->startTransaction($name);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::startTransaction()
* @see \Drupal\Core\Database\Connection::defaultOptions()
*/
function db_transaction($name = NULL, array $options = []) {
@trigger_error('db_transaction is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call startTransaction() on it. For example, $injected_database->startTransaction($name). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_transaction is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call startTransaction() on it. For example, $injected_database->startTransaction($name). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection(_db_get_target($options))->startTransaction($name);
}
......@@ -308,11 +317,13 @@ function db_transaction($name = NULL, array $options = []) {
* @return string|null
* The key of the formerly active database.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Use
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Use
* \Drupal\Core\Database\Database::setActiveConnection().
*
* @see https://www.drupal.org/node/2993033
*/
function db_set_active($key = 'default') {
@trigger_error('db_set_active() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Database\Database::setActiveConnection() instead. See https://www.drupal.org/node/2944084.', E_USER_DEPRECATED);
@trigger_error('db_set_active() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Use \Drupal\Core\Database\Database::setActiveConnection() instead. See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::setActiveConnection($key);
}
......@@ -327,15 +338,16 @@ function db_set_active($key = 'default') {
* @return string
* The escaped table name as a string.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call escapeTable() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container
* and call escapeTable() on it. For example,
* $injected_database->escapeTable($table);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::escapeTable()
*/
function db_escape_table($table) {
@trigger_error('db_escape_table() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call escapeTable() on it. For example, $injected_database->escapeTable($table). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_escape_table() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call escapeTable() on it. For example, $injected_database->escapeTable($table). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->escapeTable($table);
}
......@@ -350,15 +362,16 @@ function db_escape_table($table) {
* @return string
* The escaped field name as a string.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call escapeField() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container
* and call escapeField() on it. For example,
* $injected_database->escapeField($field);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::escapeField()
*/
function db_escape_field($field) {
@trigger_error('db_escape_field() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call escapeField() on it. For example, $injected_database->escapeField($field). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_escape_field() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call escapeField() on it. For example, $injected_database->escapeField($field). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->escapeField($field);
}
......@@ -392,15 +405,16 @@ function db_escape_field($field) {
* @return string
* The escaped string.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call escapeLike() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container
* and call escapeLike() on it. For example,
* $injected_database->escapeLike($string);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::escapeLike()
*/
function db_like($string) {
@trigger_error('db_like() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call escapeLike() on it. For example, $injected_database->escapeLike($string). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_like() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call escapeLike() on it. For example, $injected_database->escapeLike($string). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->escapeLike($string);
}
......@@ -410,14 +424,15 @@ function db_like($string) {
* @return string
* The name of the currently active database driver.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call driver() on it. For example, $injected_database->driver($string);
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container
* and call driver() on it. For example, $injected_database->driver($string);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::driver()
*/
function db_driver() {
@trigger_error('db_driver() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call driver() on it. For example, $injected_database->driver($string). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_driver() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call driver() on it. For example, $injected_database->driver($string). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->driver();
}
......@@ -428,13 +443,14 @@ function db_driver() {
* An array of options to control which connection is closed. Only the target
* key has any meaning in this case.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Use
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Use
* \Drupal\Core\Database\Database::closeConnection($target).
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Database::closeConnection()
*/
function db_close(array $options = []) {
@trigger_error('db_close() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Database\Database::closeConnection() instead. See https://www.drupal.org/node/2993033.', E_USER_DEPRECATED);
@trigger_error('db_close() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Use \Drupal\Core\Database\Database::closeConnection() instead. See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
Database::closeConnection(_db_get_target($options));
}
......@@ -488,14 +504,16 @@ function _db_get_target(array &$options, $allow_replica = TRUE) {
* @return int
* An integer number larger than any number returned before for this sequence.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container and
* call nextId() on it. For example, $injected_database->nextId($existing_id);
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container
* and call nextId() on it.
* For example, $injected_database->nextId($existing_id);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::nextId()
*/
function db_next_id($existing_id = 0) {
@trigger_error('db_next_id() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container and call nextId() on it. For example, $injected_database->nextId($existing_id). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_next_id() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call nextId() on it. For example, $injected_database->nextId($existing_id). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->nextId($existing_id);
}
......@@ -505,14 +523,15 @@ function db_next_id($existing_id = 0) {
* @return \Drupal\Core\Database\Query\Condition
* A new Condition object, set to "OR" all conditions together.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Create
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Create
* a \Drupal\Core\Database\Query\Condition object, specifying an OR
* conjunction: new Condition('OR');
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Query\Condition
*/
function db_or() {
@trigger_error('db_or() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an OR conjunction: new Condition(\'OR\'), instead. See https://www.drupal.org/node/2993033.', E_USER_DEPRECATED);
@trigger_error('db_or() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an OR conjunction: new Condition(\'OR\'), instead. See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return new Condition('OR');
}
......@@ -522,14 +541,15 @@ function db_or() {
* @return \Drupal\Core\Database\Query\Condition
* A new Condition object, set to "AND" all conditions together.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Create
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Create
* a \Drupal\Core\Database\Query\Condition object, specifying an AND
* conjunction: new Condition('AND');
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Query\Condition
*/
function db_and() {
@trigger_error('db_and() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an AND conjunction: new Condition(\'AND\'), instead. See https://www.drupal.org/node/2993033.', E_USER_DEPRECATED);
@trigger_error('db_and() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an AND conjunction: new Condition(\'AND\'), instead. See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return new Condition('AND');
}
......@@ -539,14 +559,15 @@ function db_and() {
* @return \Drupal\Core\Database\Query\Condition
* A new Condition object, set to "XOR" all conditions together.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Create
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Create
* a \Drupal\Core\Database\Query\Condition object, specifying a XOR
* conjunction: new Condition('XOR');
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Query\Condition
*/
function db_xor() {
@trigger_error('db_xor() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying a XOR conjunction: new Condition(\'XOR\'), instead. See https://www.drupal.org/node/2993033.', E_USER_DEPRECATED);
@trigger_error('db_xor() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying a XOR conjunction: new Condition(\'XOR\'), instead. See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return new Condition('XOR');
}
......@@ -563,14 +584,15 @@ function db_xor() {
* @return \Drupal\Core\Database\Query\Condition
* A new Condition object, set to the specified conjunction.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Create
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Create
* a \Drupal\Core\Database\Query\Condition object, specifying the desired
* conjunction: new Condition($conjunction);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Query\Condition
*/
function db_condition($conjunction) {
@trigger_error('db_condition() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying the desired conjunction: new Condition($conjunction), instead. See https://www.drupal.org/node/2993033.', E_USER_DEPRECATED);
@trigger_error('db_condition() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying the desired conjunction: new Condition($conjunction), instead. See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return new Condition($conjunction);
}
......@@ -592,15 +614,16 @@ function db_condition($conjunction) {
* @param array $table
* A Schema API table definition array.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call createTable() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call createTable() on it. For example,
* $injected_database->schema()->createTable($name, $table);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::createTable()
*/
function db_create_table($name, $table) {
@trigger_error('db_create_table() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call createTable() on it. For example, $injected_database->schema()->createTable($name, $table). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_create_table() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call createTable() on it. For example, $injected_database->schema()->createTable($name, $table). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->createTable($name, $table);
}
......@@ -616,15 +639,16 @@ function db_create_table($name, $table) {
* @return array
* An array of field names.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call fieldNames() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call fieldNames() on it. For example,
* $injected_database->schema()->fieldNames($fields);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::fieldNames()
*/
function db_field_names($fields) {
@trigger_error('db_field_names() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call fieldNames() on it. For example, $injected_database->schema()->fieldNames($fields). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_field_names() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call fieldNames() on it. For example, $injected_database->schema()->fieldNames($fields). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->fieldNames($fields);
}
......@@ -639,15 +663,16 @@ function db_field_names($fields) {
* @return bool
* TRUE if the given index exists, otherwise FALSE.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call indexExists() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call indexExists() on it. For example,
* $injected_database->schema()->indexExists($table, $name);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::indexExists()
*/
function db_index_exists($table, $name) {
@trigger_error('db_index_exists() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call indexExists() on it. For example, $injected_database->schema()->indexExists($table, $name). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_index_exists() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call indexExists() on it. For example, $injected_database->schema()->indexExists($table, $name). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->indexExists($table, $name);
}
......@@ -660,16 +685,17 @@ function db_index_exists($table, $name) {
* @return bool
* TRUE if the given table exists, otherwise FALSE.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call tableExists() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call tableExists() on it. For example,
* $injected_database->schema()->tableExists($table);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::tableExists()
*/
function db_table_exists($table) {
@trigger_error(
'db_table_exists() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Use $injected_database->schema()->tableExists($table) instead. See https://www.drupal.org/node/2947929.',
'db_table_exists() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Use $injected_database->schema()->tableExists($table) instead. See https://www.drupal.org/node/2993033',
E_USER_DEPRECATED
);
......@@ -687,15 +713,16 @@ function db_table_exists($table) {
* @return bool
* TRUE if the given column exists, otherwise FALSE.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call fieldExists() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call fieldExists() on it. For example,
* $injected_database->schema()->fieldExists($table, $field);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::fieldExists()
*/
function db_field_exists($table, $field) {
@trigger_error('db_field_exists() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call fieldExists() on it. For example, $injected_database->schema()->fieldExists($table, $field). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_field_exists() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call fieldExists() on it. For example, $injected_database->schema()->fieldExists($table, $field). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->fieldExists($table, $field);
}
......@@ -708,16 +735,17 @@ function db_field_exists($table, $field) {
* @return array
* Array, both the keys and the values are the matching tables.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call findTables() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call findTables() on it. For example,
* $injected_database->schema()->findTables($table_expression);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::findTables()
*/
function db_find_tables($table_expression) {
@trigger_error(
'db_find_tables() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Use $injected_database->schema()->findTables($table_expression) instead. See https://www.drupal.org/node/2993033',
'db_find_tables() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Use $injected_database->schema()->findTables($table_expression) instead. See https://www.drupal.org/node/2993033',
E_USER_DEPRECATED
);
return Database::getConnection()->schema()->findTables($table_expression);
......@@ -731,15 +759,16 @@ function db_find_tables($table_expression) {
* @param $new_name
* The new name for the table.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call renameTable() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call renameTable() on it. For example,
* $injected_database->schema()->renameTable($table, $new_name);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::renameTable()
*/
function db_rename_table($table, $new_name) {
@trigger_error('db_rename_table() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call renameTable() on it. For example, $injected_database->schema()->renameTable($table, $new_name). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_rename_table() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call renameTable() on it. For example, $injected_database->schema()->renameTable($table, $new_name). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->renameTable($table, $new_name);
}
......@@ -749,15 +778,16 @@ function db_rename_table($table, $new_name) {
* @param $table
* The table to be dropped.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call dropTable() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call dropTable() on it. For example,
* $injected_database->schema()->dropTable($table);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::dropTable()
*/
function db_drop_table($table) {
@trigger_error('db_drop_table() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\Database\Database::getConnection()->schema()->dropTable() instead. See https://www.drupal.org/node/2987737', E_USER_DEPRECATED);
@trigger_error('db_drop_table() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Use \Drupal\Core\Database\Database::getConnection()->schema()->dropTable() instead. See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->dropTable($table);
}
......@@ -780,16 +810,17 @@ function db_drop_table($table) {
* MUST specify at least one key or index including it in this array. See
* \Drupal\Core\Database\Schema::changeField() for more explanation why.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call addField() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call addField() on it. For example,
* $injected_database->schema()->addField($table, $field, $spec, $keys_new);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::addField()
* @see \Drupal\Core\Database\Schema::changeField()
*/
function db_add_field($table, $field, $spec, $keys_new = []) {
@trigger_error('db_add_field() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addField() on it. For example, $injected_database->schema()->addField($table, $field, $spec, $keys_new). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_add_field() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addField() on it. For example, $injected_database->schema()->addField($table, $field, $spec, $keys_new). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->addField($table, $field, $spec, $keys_new);
}
......@@ -805,15 +836,16 @@ function db_add_field($table, $field, $spec, $keys_new = []) {
* TRUE if the field was successfully dropped, FALSE if there was no field by
* that name to begin with.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call dropField() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call dropField() on it. For example,
* $injected_database->schema()->dropField($table, $field);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::dropField()
*/
function db_drop_field($table, $field) {
@trigger_error('db_drop_field() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropField() on it. For example, $injected_database->schema()->dropField($table, $field). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_drop_field() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropField() on it. For example, $injected_database->schema()->dropField($table, $field). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->dropField($table, $field);
}
......@@ -827,16 +859,18 @@ function db_drop_field($table, $field) {
* @param $default
* Default value to be set. NULL for 'default NULL'.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call changeField() on it, passing a full field
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call changeField() on it, passing a full field
* specification. For example,
* $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new);
* $injected_database->schema()
* ->changeField($table, $field, $field_new, $spec, $keys_new);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::changeField()
*/
function db_field_set_default($table, $field, $default) {
@trigger_error('db_field_set_default() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it, passing a full field specification. For example, $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_field_set_default() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it, passing a full field specification. For example, $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->fieldSetDefault($table, $field, $default);
}
......@@ -848,16 +882,18 @@ function db_field_set_default($table, $field, $default) {
* @param $field
* The field to be altered.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call changeField() on it, passing a full field
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call changeField() on it, passing a full field
* specification. For example,
* $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new);
* $injected_database->schema()
* ->changeField($table, $field, $field_new, $spec, $keys_new);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::changeField()
*/
function db_field_set_no_default($table, $field) {
@trigger_error('db_field_set_no_default() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it, passing a full field specification. For example, $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_field_set_no_default() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call changeField() on it, passing a full field specification. For example, $injected_database->schema()->changeField($table, $field, $field_new, $spec, $keys_new). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
return Database::getConnection()->schema()->fieldSetNoDefault($table, $field);
}
......@@ -869,15 +905,16 @@ function db_field_set_no_default($table, $field) {
* @param $fields
* Array of fields for the primary key.
*
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get
* a database connection injected into your service from the container, get
* its schema driver, and call addPrimaryKey() on it. For example,
* @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* get a database connection injected into your service from the container,
* get its schema driver, and call addPrimaryKey() on it. For example,
* $injected_database->schema()->addPrimaryKey($table, $fields);
*
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::addPrimaryKey()
*/
function db_add_primary_key($table, $fields) {
@trigger_error('db_add_primary_key() is deprecated in Drupal 8.0.x and will be removed before Drupal 9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addPrimaryKey() on it. For example, $injected_database->schema()->addPrimaryKey($table, $fields). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);
@trigger_error('db_add_primary_key() is deprecated in drupal:8.0.0. It will be removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addPrimaryKey() on it. For example, $injected_database->schema()->addPrimaryKey($table, $fields). See https://www.drupal.org/node/2993033', E_USER_DEPRECATED);