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 = []) { ...@@ -80,16 +80,17 @@ function db_query($query, array $args = [], array $options = []) {
* @return \Drupal\Core\Database\StatementInterface * @return \Drupal\Core\Database\StatementInterface
* A prepared statement object, already executed. * A prepared statement object, already executed.
* *
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container and * get a database connection injected into your service from the container
* call queryRange() on it. For example, * and call queryRange() on it. For example,
* $injected_database->queryRange($query, $from, $count, $args, $options); * $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::queryRange()
* @see \Drupal\Core\Database\Connection::defaultOptions() * @see \Drupal\Core\Database\Connection::defaultOptions()
*/ */
function db_query_range($query, $from, $count, array $args = [], array $options = []) { 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); 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 ...@@ -113,16 +114,17 @@ function db_query_range($query, $from, $count, array $args = [], array $options
* @return string * @return string
* The name of the temporary table. * The name of the temporary table.
* *
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container and * get a database connection injected into your service from the container
* call queryTemporary() on it. For example, * and call queryTemporary() on it. For example,
* $injected_database->queryTemporary($query, $args, $options); * $injected_database->queryTemporary($query, $args, $options);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::queryTemporary() * @see \Drupal\Core\Database\Connection::queryTemporary()
* @see \Drupal\Core\Database\Connection::defaultOptions() * @see \Drupal\Core\Database\Connection::defaultOptions()
*/ */
function db_query_temporary($query, array $args = [], array $options = []) { 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); return Database::getConnection(_db_get_target($options))->queryTemporary($query, $args, $options);
} }
...@@ -142,11 +144,12 @@ function db_query_temporary($query, array $args = [], array $options = []) { ...@@ -142,11 +144,12 @@ function db_query_temporary($query, array $args = [], array $options = []) {
* call insert() on it. For example, * call insert() on it. For example,
* $injected_database->insert($table, $options); * $injected_database->insert($table, $options);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::insert() * @see \Drupal\Core\Database\Connection::insert()
* @see \Drupal\Core\Database\Connection::defaultOptions() * @see \Drupal\Core\Database\Connection::defaultOptions()
*/ */
function db_insert($table, array $options = []) { 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); return Database::getConnection(_db_get_target($options, FALSE))->insert($table, $options);
} }
...@@ -166,11 +169,12 @@ function db_insert($table, array $options = []) { ...@@ -166,11 +169,12 @@ function db_insert($table, array $options = []) {
* call merge() on it. For example, * call merge() on it. For example,
* $injected_database->merge($table, $options); * $injected_database->merge($table, $options);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::merge() * @see \Drupal\Core\Database\Connection::merge()
* @see \Drupal\Core\Database\Connection::defaultOptions() * @see \Drupal\Core\Database\Connection::defaultOptions()
*/ */
function db_merge($table, array $options = []) { 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); return Database::getConnection(_db_get_target($options, FALSE))->merge($table, $options);
} }
...@@ -190,11 +194,12 @@ function db_merge($table, array $options = []) { ...@@ -190,11 +194,12 @@ function db_merge($table, array $options = []) {
* call update() on it. For example, * call update() on it. For example,
* $injected_database->update($table, $options); * $injected_database->update($table, $options);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::update() * @see \Drupal\Core\Database\Connection::update()
* @see \Drupal\Core\Database\Connection::defaultOptions() * @see \Drupal\Core\Database\Connection::defaultOptions()
*/ */
function db_update($table, array $options = []) { 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); return Database::getConnection(_db_get_target($options, FALSE))->update($table, $options);
} }
...@@ -214,11 +219,12 @@ function db_update($table, array $options = []) { ...@@ -214,11 +219,12 @@ function db_update($table, array $options = []) {
* call delete() on it. For example, * call delete() on it. For example,
* $injected_database->delete($table, $options); * $injected_database->delete($table, $options);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::delete() * @see \Drupal\Core\Database\Connection::delete()
* @see \Drupal\Core\Database\Connection::defaultOptions() * @see \Drupal\Core\Database\Connection::defaultOptions()
*/ */
function db_delete($table, array $options = []) { 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); return Database::getConnection(_db_get_target($options, FALSE))->delete($table, $options);
} }
...@@ -238,11 +244,12 @@ function db_delete($table, array $options = []) { ...@@ -238,11 +244,12 @@ function db_delete($table, array $options = []) {
* call truncate() on it. For example, * call truncate() on it. For example,
* $injected_database->truncate($table, $options); * $injected_database->truncate($table, $options);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::truncate() * @see \Drupal\Core\Database\Connection::truncate()
* @see \Drupal\Core\Database\Connection::defaultOptions() * @see \Drupal\Core\Database\Connection::defaultOptions()
*/ */
function db_truncate($table, array $options = []) { 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); return Database::getConnection(_db_get_target($options, FALSE))->truncate($table, $options);
} }
...@@ -266,11 +273,12 @@ function db_truncate($table, array $options = []) { ...@@ -266,11 +273,12 @@ function db_truncate($table, array $options = []) {
* call select() on it. For example, * call select() on it. For example,
* $injected_database->select($table, $alias, $options); * $injected_database->select($table, $alias, $options);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::select() * @see \Drupal\Core\Database\Connection::select()
* @see \Drupal\Core\Database\Connection::defaultOptions() * @see \Drupal\Core\Database\Connection::defaultOptions()
*/ */
function db_select($table, $alias = NULL, array $options = []) { 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); return Database::getConnection(_db_get_target($options))->select($table, $alias, $options);
} }
...@@ -286,16 +294,17 @@ function db_select($table, $alias = NULL, array $options = []) { ...@@ -286,16 +294,17 @@ function db_select($table, $alias = NULL, array $options = []) {
* @return \Drupal\Core\Database\Transaction * @return \Drupal\Core\Database\Transaction
* A new Transaction object for this connection. * 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 * a database connection injected into your service from the container and
* call startTransaction() on it. For example, * call startTransaction() on it. For example,
* $injected_database->startTransaction($name); * $injected_database->startTransaction($name);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::startTransaction() * @see \Drupal\Core\Database\Connection::startTransaction()
* @see \Drupal\Core\Database\Connection::defaultOptions() * @see \Drupal\Core\Database\Connection::defaultOptions()
*/ */
function db_transaction($name = NULL, array $options = []) { 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); return Database::getConnection(_db_get_target($options))->startTransaction($name);
} }
...@@ -308,11 +317,13 @@ function db_transaction($name = NULL, array $options = []) { ...@@ -308,11 +317,13 @@ function db_transaction($name = NULL, array $options = []) {
* @return string|null * @return string|null
* The key of the formerly active database. * 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(). * \Drupal\Core\Database\Database::setActiveConnection().
*
* @see https://www.drupal.org/node/2993033
*/ */
function db_set_active($key = 'default') { 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); return Database::setActiveConnection($key);
} }
...@@ -327,15 +338,16 @@ function db_set_active($key = 'default') { ...@@ -327,15 +338,16 @@ function db_set_active($key = 'default') {
* @return string * @return string
* The escaped table name as a 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 * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container and * get a database connection injected into your service from the container
* call escapeTable() on it. For example, * and call escapeTable() on it. For example,
* $injected_database->escapeTable($table); * $injected_database->escapeTable($table);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::escapeTable() * @see \Drupal\Core\Database\Connection::escapeTable()
*/ */
function db_escape_table($table) { 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); return Database::getConnection()->escapeTable($table);
} }
...@@ -350,15 +362,16 @@ function db_escape_table($table) { ...@@ -350,15 +362,16 @@ function db_escape_table($table) {
* @return string * @return string
* The escaped field name as a 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 * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container and * get a database connection injected into your service from the container
* call escapeField() on it. For example, * and call escapeField() on it. For example,
* $injected_database->escapeField($field); * $injected_database->escapeField($field);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::escapeField() * @see \Drupal\Core\Database\Connection::escapeField()
*/ */
function db_escape_field($field) { 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); return Database::getConnection()->escapeField($field);
} }
...@@ -392,15 +405,16 @@ function db_escape_field($field) { ...@@ -392,15 +405,16 @@ function db_escape_field($field) {
* @return string * @return string
* The escaped string. * The escaped string.
* *
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container and * get a database connection injected into your service from the container
* call escapeLike() on it. For example, * and call escapeLike() on it. For example,
* $injected_database->escapeLike($string); * $injected_database->escapeLike($string);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::escapeLike() * @see \Drupal\Core\Database\Connection::escapeLike()
*/ */
function db_like($string) { 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); return Database::getConnection()->escapeLike($string);
} }
...@@ -410,14 +424,15 @@ function db_like($string) { ...@@ -410,14 +424,15 @@ function db_like($string) {
* @return string * @return string
* The name of the currently active database driver. * 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 * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container and * get a database connection injected into your service from the container
* call driver() on it. For example, $injected_database->driver($string); * and call driver() on it. For example, $injected_database->driver($string);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Connection::driver() * @see \Drupal\Core\Database\Connection::driver()
*/ */
function db_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(); return Database::getConnection()->driver();
} }
...@@ -428,13 +443,14 @@ function db_driver() { ...@@ -428,13 +443,14 @@ function db_driver() {
* An array of options to control which connection is closed. Only the target * An array of options to control which connection is closed. Only the target
* key has any meaning in this case. * 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). * \Drupal\Core\Database\Database::closeConnection($target).
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Database::closeConnection() * @see \Drupal\Core\Database\Database::closeConnection()
*/ */
function db_close(array $options = []) { 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)); Database::closeConnection(_db_get_target($options));
} }
...@@ -488,14 +504,16 @@ function _db_get_target(array &$options, $allow_replica = TRUE) { ...@@ -488,14 +504,16 @@ function _db_get_target(array &$options, $allow_replica = TRUE) {
* @return int * @return int
* An integer number larger than any number returned before for this sequence. * 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 * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container and * get a database connection injected into your service from the container
* call nextId() on it. For example, $injected_database->nextId($existing_id); * 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() * @see \Drupal\Core\Database\Connection::nextId()
*/ */
function db_next_id($existing_id = 0) { 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); return Database::getConnection()->nextId($existing_id);
} }
...@@ -505,14 +523,15 @@ function db_next_id($existing_id = 0) { ...@@ -505,14 +523,15 @@ function db_next_id($existing_id = 0) {
* @return \Drupal\Core\Database\Query\Condition * @return \Drupal\Core\Database\Query\Condition
* A new Condition object, set to "OR" all conditions together. * 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 * a \Drupal\Core\Database\Query\Condition object, specifying an OR
* conjunction: new Condition('OR'); * conjunction: new Condition('OR');
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Query\Condition * @see \Drupal\Core\Database\Query\Condition
*/ */
function db_or() { 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'); return new Condition('OR');
} }
...@@ -522,14 +541,15 @@ function db_or() { ...@@ -522,14 +541,15 @@ function db_or() {
* @return \Drupal\Core\Database\Query\Condition * @return \Drupal\Core\Database\Query\Condition
* A new Condition object, set to "AND" all conditions together. * 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 * a \Drupal\Core\Database\Query\Condition object, specifying an AND
* conjunction: new Condition('AND'); * conjunction: new Condition('AND');
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Query\Condition * @see \Drupal\Core\Database\Query\Condition
*/ */
function db_and() { 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'); return new Condition('AND');
} }
...@@ -539,14 +559,15 @@ function db_and() { ...@@ -539,14 +559,15 @@ function db_and() {
* @return \Drupal\Core\Database\Query\Condition * @return \Drupal\Core\Database\Query\Condition
* A new Condition object, set to "XOR" all conditions together. * 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 * a \Drupal\Core\Database\Query\Condition object, specifying a XOR
* conjunction: new Condition('XOR'); * conjunction: new Condition('XOR');
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Query\Condition * @see \Drupal\Core\Database\Query\Condition
*/ */
function db_xor() { 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'); return new Condition('XOR');
} }
...@@ -563,14 +584,15 @@ function db_xor() { ...@@ -563,14 +584,15 @@ function db_xor() {
* @return \Drupal\Core\Database\Query\Condition * @return \Drupal\Core\Database\Query\Condition
* A new Condition object, set to the specified conjunction. * 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 * a \Drupal\Core\Database\Query\Condition object, specifying the desired
* conjunction: new Condition($conjunction); * conjunction: new Condition($conjunction);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Query\Condition * @see \Drupal\Core\Database\Query\Condition
*/ */
function db_condition($conjunction) { 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); return new Condition($conjunction);
} }
...@@ -592,15 +614,16 @@ function db_condition($conjunction) { ...@@ -592,15 +614,16 @@ function db_condition($conjunction) {
* @param array $table * @param array $table
* A Schema API table definition array. * A Schema API table definition array.
* *
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container, get * get a database connection injected into your service from the container,
* its schema driver, and call createTable() on it. For example, * get its schema driver, and call createTable() on it. For example,
* $injected_database->schema()->createTable($name, $table); * $injected_database->schema()->createTable($name, $table);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::createTable() * @see \Drupal\Core\Database\Schema::createTable()
*/ */
function db_create_table($name, $table) { 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); return Database::getConnection()->schema()->createTable($name, $table);
} }
...@@ -616,15 +639,16 @@ function db_create_table($name, $table) { ...@@ -616,15 +639,16 @@ function db_create_table($name, $table) {
* @return array * @return array
* An array of field names. * An array of field names.
* *
* @deprecated as of Drupal 8.0.x, will be removed in Drupal 9.0.0. Instead, get * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container, get * get a database connection injected into your service from the container,
* its schema driver, and call fieldNames() on it. For example, * get its schema driver, and call fieldNames() on it. For example,
* $injected_database->schema()->fieldNames($fields); * $injected_database->schema()->fieldNames($fields);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::fieldNames() * @see \Drupal\Core\Database\Schema::fieldNames()
*/ */
function db_field_names($fields) { 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); return Database::getConnection()->schema()->fieldNames($fields);
} }
...@@ -639,15 +663,16 @@ function db_field_names($fields) { ...@@ -639,15 +663,16 @@ function db_field_names($fields) {
* @return bool * @return bool
* TRUE if the given index exists, otherwise FALSE. * 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 * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container, get * get a database connection injected into your service from the container,
* its schema driver, and call indexExists() on it. For example, * get its schema driver, and call indexExists() on it. For example,
* $injected_database->schema()->indexExists($table, $name); * $injected_database->schema()->indexExists($table, $name);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::indexExists() * @see \Drupal\Core\Database\Schema::indexExists()
*/ */
function db_index_exists($table, $name) { 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); return Database::getConnection()->schema()->indexExists($table, $name);
} }
...@@ -660,16 +685,17 @@ function db_index_exists($table, $name) { ...@@ -660,16 +685,17 @@ function db_index_exists($table, $name) {
* @return bool * @return bool
* TRUE if the given table exists, otherwise FALSE. * 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 * @deprecated in drupal:8.0.0 and will be removed from drupal:9.0.0. Instead,
* a database connection injected into your service from the container, get * get a database connection injected into your service from the container,
* its schema driver, and call tableExists() on it. For example, * get its schema driver, and call tableExists() on it. For example,
* $injected_database->schema()->tableExists($table); * $injected_database->schema()->tableExists($table);
* *
* @see https://www.drupal.org/node/2993033
* @see \Drupal\Core\Database\Schema::tableExists() * @see \Drupal\Core\Database\Schema::tableExists()
*/ */