Functions - 8.9.x - drupal

Primary tabs

Title Deprecated File name Summary Direct uses Strings
db_add_primary_key

in drupal:8.0.0 and is 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);

core/includes/database.inc Adds a primary key to a database table. 1
db_add_unique_key

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call addUniqueKey() on it. For example, $injected_database->schema()->addUniqueKey($table, $name, $fields);

core/includes/database.inc Adds a unique key. 1
db_and

in drupal:8.0.0 and is removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an AND conjunction: new Condition('AND');

core/includes/database.inc Returns a new DatabaseCondition, set to "AND" all conditions together. 1
db_change_field

in drupal:8.0.0 and is 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. For example, $injected_database->schema() ->changeField($table, $field, $field_new, $spec, $keys_new);

core/includes/database.inc Changes a field definition. 1
db_close

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Database\Database::closeConnection($target).

core/includes/database.inc Closes the active database connection. 1
db_condition

in drupal:8.0.0 and is removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying the desired conjunction: new Condition($conjunction);

core/includes/database.inc Returns a new DatabaseCondition, set to the specified conjunction. 1
db_create_table

in drupal:8.0.0 and is 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);

core/includes/database.inc Creates a new table from a Drupal table definition. 1
db_delete

in drupal:8.0.0 and is 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);

core/includes/database.inc Returns a new DeleteQuery object for the active database. 1
db_driver

in drupal:8.0.0 and is 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);

core/includes/database.inc Retrieves the name of the currently active database driver. 1
db_drop_field

in drupal:8.0.0 and is 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);

core/includes/database.inc Drops a field. 1
db_drop_index

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropIndex() on it. For example, $injected_database->schema()->dropIndex($table, $name);

core/includes/database.inc Drops an index. 1
db_drop_primary_key

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropPrimaryKey() on it. For example, $injected_database->schema()->dropPrimaryKey($table);

core/includes/database.inc Drops the primary key of a database table. 1
db_drop_table

in drupal:8.0.0 and is 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);

core/includes/database.inc Drops a table. 1
db_drop_unique_key

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container, get its schema driver, and call dropUniqueKey() on it. For example, $injected_database->schema()->dropUniqueKey($table, $name);

core/includes/database.inc Drops a unique key. 1
db_escape_field

in drupal:8.0.0 and is 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);

core/includes/database.inc Restricts a dynamic column or constraint name to safe characters. 1
db_escape_table

in drupal:8.0.0 and is 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);

core/includes/database.inc Restricts a dynamic table name to safe characters. 1
db_field_exists

in drupal:8.0.0 and is 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);

core/includes/database.inc Checks if a column exists in the given table. 1
db_field_names

in drupal:8.0.0 and is 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);

core/includes/database.inc Returns an array of field names from an array of key/index column specifiers. 1
db_field_set_default

in drupal:8.0.0 and is 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);

core/includes/database.inc Sets the default value for a field. 1
db_field_set_no_default

in drupal:8.0.0 and is 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);

core/includes/database.inc Sets a field to have no default value. 1
db_find_tables

in drupal:8.0.0 and is 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);

core/includes/database.inc Finds all tables that are like the specified base table name. 1
db_ignore_replica

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal::service('database.replica_kill_switch')->trigger() instead.

core/includes/database.inc Sets a session variable specifying the lag time for ignoring a replica server (A replica server is traditionally referred to as a "slave" in database server documentation). 1
db_index_exists

in drupal:8.0.0 and is 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);

core/includes/database.inc Checks if an index exists in the given table. 1
db_insert

in drupal:8.0.0 and is 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);

core/includes/database.inc Returns a new InsertQuery object for the active database. 1
db_installer_object core/includes/install.inc Returns a database installer object. 2
db_like

in drupal:8.0.0 and is 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);

core/includes/database.inc Escapes characters that work as wildcard characters in a LIKE pattern. 1
db_merge

in drupal:8.0.0 and is 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);

core/includes/database.inc Returns a new MergeQuery object for the active database. 1
db_next_id

in drupal:8.0.0 and is 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);

core/includes/database.inc Retrieves a unique id. 1
db_or

in drupal:8.0.0 and is removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying an OR conjunction: new Condition('OR');

core/includes/database.inc Returns a new DatabaseCondition, set to "OR" all conditions together. 1
db_query

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call query() on it. For example, $injected_database->query($query, $args, $options);

core/includes/database.inc Executes an arbitrary query string against the active database. 1 1
db_query_range

in drupal:8.0.0 and is 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);

core/includes/database.inc Executes a query against the active database, restricted to a range. 1
db_query_temporary

in drupal:8.0.0 and is 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);

core/includes/database.inc Executes a SELECT query string and saves the result set to a temporary table. 1
db_rename_table

in drupal:8.0.0 and is 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);

core/includes/database.inc Renames a table. 1
db_select

in drupal:8.0.0 and is 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->select($table, $alias, $options);

core/includes/database.inc Returns a new SelectQuery object for the active database. 1
db_set_active

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Database\Database::setActiveConnection().

core/includes/database.inc Sets a new active database. 1
db_table_exists

in drupal:8.0.0 and is 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);

core/includes/database.inc Checks if a table exists. 1
db_transaction

in drupal:8.0.0 and is 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);

core/includes/database.inc Returns a new transaction object for the active database. 1
db_truncate

in drupal:8.0.0 and is 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);

core/includes/database.inc Returns a new TruncateQuery object for the active database. 1
db_update

in drupal:8.0.0 and is removed from drupal:9.0.0. Instead, get a database connection injected into your service from the container and call update() on it. For example, $injected_database->update($table, $options);

core/includes/database.inc Returns a new UpdateQuery object for the active database. 1
db_xor

in drupal:8.0.0 and is removed from drupal:9.0.0. Create a \Drupal\Core\Database\Query\Condition object, specifying a XOR conjunction: new Condition('XOR');

core/includes/database.inc Returns a new DatabaseCondition, set to "XOR" all conditions together. 1
debug core/includes/common.inc Outputs debug information. 8 17
delay_cache_tags_invalidation_entity_test_insert core/modules/system/tests/modules/delay_cache_tags_invalidation/delay_cache_tags_invalidation.module Implements hook_ENTITY_TYPE_insert().
delay_cache_tags_invalidation_user_insert core/modules/system/tests/modules/delay_cache_tags_invalidation/delay_cache_tags_invalidation.module Implements hook_ENTITY_TYPE_insert().
demo_umami_content_install core/profiles/demo_umami/modules/demo_umami_content/demo_umami_content.install Implements hook_install().
demo_umami_content_uninstall core/profiles/demo_umami/modules/demo_umami_content/demo_umami_content.install Implements hook_uninstall().
demo_umami_form_install_configure_form_alter core/profiles/demo_umami/demo_umami.profile Implements hook_form_FORM_ID_alter() for install_configure_form().
demo_umami_form_install_configure_submit core/profiles/demo_umami/demo_umami.profile Submission handler to sync the contact.form.feedback recipient. 1
demo_umami_install core/profiles/demo_umami/demo_umami.install Implements hook_install().
demo_umami_requirements core/profiles/demo_umami/demo_umami.install Implements hook_requirements().
demo_umami_set_users_passwords core/profiles/demo_umami/demo_umami.profile Sets the password of admin to be the password for all users. 1

Other projects


Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.