Classes, traits, and interfaces - 9.5.x - drupal

Primary tabs

Introduction to classes

A lot of the PHP code in Drupal is object oriented (OO), making use of PHP classes, interfaces, and traits. See the Objected-oriented programming conventions for more information.

See also

Objected-oriented programming conventions

File

core/core.api.php, line 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
D7NodeDeriver class Drupal\node\Plugin\migrate core/modules/node/src/Plugin/migrate/D7NodeDeriver.php Deriver for Drupal 7 node and node revision migrations based on node types. 5
D7NodeTranslation class Drupal\node\Plugin\migrate core/modules/node/src/Plugin/migrate/D7NodeTranslation.php Migration plugin for the Drupal 7 node translations. 2
D7TaxonomyTermDeriver class Drupal\taxonomy\Plugin\migrate core/modules/taxonomy/src/Plugin/migrate/D7TaxonomyTermDeriver.php Deriver for Drupal 7 taxonomy term migrations based on vocabularies. 2
Data abstract class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/Data.php Represents the `data` and `included` objects of a top-level object. 2 4
Database abstract class Drupal\Core\Database core/lib/Drupal/Core/Database/Database.php Primary front-controller for the database system. 250
DatabaseAccessDeniedException class Drupal\Core\Database core/lib/Drupal/Core/Database/DatabaseAccessDeniedException.php Exception thrown if access credentials fail. 2
DatabaseBackend class Drupal\Core\Flood core/lib/Drupal/Core/Flood/DatabaseBackend.php Defines the database flood backend. This is the default Drupal backend. 2 2
DatabaseBackend class Drupal\Core\Cache core/lib/Drupal/Core/Cache/DatabaseBackend.php Defines a default cache implementation. 4
DatabaseBackendFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/DatabaseBackendFactory.php 2 2
DatabaseBackendFactoryTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/DatabaseBackendFactoryTest.php @coversDefaultClass \Drupal\Core\Cache\DatabaseBackendFactory @group Cache
DatabaseBackendTagTest class Drupal\KernelTests\Core\Cache core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTagTest.php Tests DatabaseBackend cache tag implementation.
DatabaseBackendTest class Drupal\KernelTests\Core\Cache core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php Unit test of the database backend using the generic cache unit test base.
DatabaseCacheTagsChecksum class Drupal\Core\Cache core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php Cache tags invalidations checksum implementation that uses the database. 2
DatabaseDriverProvidedByModuleTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/DatabaseDriverProvidedByModuleTest.php Tests output on the status overview page.
DatabaseDriverUninstallValidator class Drupal\Core\ProxyClass\Extension core/lib/Drupal/Core/ProxyClass/Extension/DatabaseDriverUninstallValidator.php Provides a proxy class for \Drupal\Core\Extension\DatabaseDriverUninstallValidator.
DatabaseDriverUninstallValidator class Drupal\Core\Extension core/lib/Drupal/Core/Extension/DatabaseDriverUninstallValidator.php Ensures installed modules providing a database driver are not uninstalled. 2
DatabaseException interface Drupal\Core\Database core/lib/Drupal/Core/Database/DatabaseException.php Interface for a database exception. 19 19
DatabaseExceptionWrapper class Drupal\Core\Database core/lib/Drupal/Core/Database/DatabaseExceptionWrapper.php This wrapper class serves only to provide additional debug information. 28
DatabaseExceptionWrapperTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/DatabaseExceptionWrapperTest.php Tests exceptions thrown by queries.
DatabaseExceptionWrapperTest class Drupal\Tests\mysql\Kernel\mysql core/modules/mysql/tests/src/Kernel/mysql/DatabaseExceptionWrapperTest.php Tests exceptions thrown by queries.
DatabaseExceptionWrapperTest class Drupal\Tests\sqlite\Kernel\sqlite core/modules/sqlite/tests/src/Kernel/sqlite/DatabaseExceptionWrapperTest.php Tests exceptions thrown by queries.
DatabaseExceptionWrapperTest class Drupal\Tests\pgsql\Kernel\pgsql core/modules/pgsql/tests/src/Kernel/pgsql/DatabaseExceptionWrapperTest.php Tests exceptions thrown by queries.
DatabaseFileUsageBackend class Drupal\file\FileUsage core/modules/file/src/FileUsage/DatabaseFileUsageBackend.php Defines the database file usage backend. This is the default Drupal backend. 2
DatabaseLockBackend class Drupal\Core\Lock core/lib/Drupal/Core/Lock/DatabaseLockBackend.php Defines the database lock backend. This is the default backend in Drupal. 1 2 2
DatabaseLockBackend class Drupal\Core\ProxyClass\Lock core/lib/Drupal/Core/ProxyClass/Lock/DatabaseLockBackend.php Provides a proxy class for \Drupal\Core\Lock\DatabaseLockBackend.
DatabaseNotFoundException class Drupal\Core\Database core/lib/Drupal/Core/Database/DatabaseNotFoundException.php Exception thrown if specified database is not found. 8
DatabaseQueue class Drupal\Core\Queue core/lib/Drupal/Core/Queue/DatabaseQueue.php Default queue implementation. 1 2
DatabaseStorage class Drupal\Core\Config core/lib/Drupal/Core/Config/DatabaseStorage.php Defines the Database storage. 3 3
DatabaseStorage class Drupal\Core\KeyValueStore core/lib/Drupal/Core/KeyValueStore/DatabaseStorage.php Defines a default key/value store implementation. 1
DatabaseStorageExpirable class Drupal\Core\KeyValueStore core/lib/Drupal/Core/KeyValueStore/DatabaseStorageExpirable.php Defines a default key/value store implementation for expiring items. 1
DatabaseStorageExpirableTest class Drupal\KernelTests\Core\KeyValueStore core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php Tests the key-value database storage.
DatabaseStorageTest class Drupal\KernelTests\Core\KeyValueStore core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageTest.php Tests the key-value database storage.
DatabaseStorageTest class Drupal\KernelTests\Core\Config\Storage core/tests/Drupal/KernelTests/Core/Config/Storage/DatabaseStorageTest.php Tests DatabaseStorage operations.
DatabaseTest class Drupal\Tests\Core\Database core/tests/Drupal/Tests/Core/Database/DatabaseTest.php @coversDefaultClass \Drupal\Core\Database\Database
DatabaseTestBase abstract class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php Base class for databases database tests. 32
DatabaseTestBase abstract class Drupal\Tests\system\Functional\Database core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php Base class for databases database tests. 3
DatabaseTestController class Drupal\database_test\Controller core/modules/system/tests/modules/database_test/src/Controller/DatabaseTestController.php Controller routines for database_test routes.
DatabaseTestForm class Drupal\database_test\Form core/modules/system/tests/modules/database_test/src/Form/DatabaseTestForm.php Form controller for database_test module. 1
DatabaseTestSchemaDataTrait trait Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/DatabaseTestSchemaDataTrait.php Trait to manage data samples for test tables. 1
DatabaseTestSchemaInstallTrait trait Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/DatabaseTestSchemaInstallTrait.php Trait to manage installation for test tables.
DatabaseVersionCheckUpdateTest class Drupal\Tests\system\Functional\Update core/modules/system/tests/src/Functional/Update/DatabaseVersionCheckUpdateTest.php Tests that updates fail if the database does not meet the minimum version.
DataCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/DataCommand.php An AJAX command for implementing jQuery's data() method. 3
DataDefinition class Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/DataDefinition.php A typed data definition class for defining data based on defined data types. 5 55
DataDefinitionInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/DataDefinitionInterface.php Interface for data definitions. 4 12
DataEntityRow class Drupal\rest\Plugin\views\row core/modules/rest/src/Plugin/views/row/DataEntityRow.php Plugin which displays entities as raw data.
DataFieldRow class Drupal\rest\Plugin\views\row core/modules/rest/src/Plugin/views/row/DataFieldRow.php Plugin which displays fields as raw data.
DataNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/DataNormalizer.php Normalizes JSON:API Data objects. 2
DataReferenceBase abstract class Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/DataReferenceBase.php Base class for typed data references. 2 2
DataReferenceDefinition class Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/DataReferenceDefinition.php A typed data definition class for defining references. 4
DataReferenceDefinitionInterface interface Drupal\Core\TypedData core/lib/Drupal/Core/TypedData/DataReferenceDefinitionInterface.php Interface for typed data references. 1 6

Other projects


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