Classes, traits, and interfaces - 11.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 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
ConfigurableLanguageXmlAnonTest class Drupal\Tests\language\Functional\Rest core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageXmlAnonTest.php @group rest
ConfigurableLanguageXmlBasicAuthTest class Drupal\Tests\language\Functional\Rest core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageXmlBasicAuthTest.php @group rest
ConfigurableLanguageXmlCookieTest class Drupal\Tests\language\Functional\Rest core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageXmlCookieTest.php @group rest
ConfigurablePlugin class Drupal\Tests\Core\Plugin core/tests/Drupal/Tests/Core/Plugin/DefaultSingleLazyPluginCollectionTest.php
ConfigurablePluginTest class Drupal\Tests\ckeditor5\Kernel core/modules/ckeditor5/tests/src/Kernel/ConfigurablePluginTest.php Tests configurable plugins.
ConfigurableSearchPluginBase abstract class Drupal\search\Plugin core/modules/search/src/Plugin/ConfigurableSearchPluginBase.php Provides a base implementation for a configurable Search plugin. 2 3
ConfigurableSearchPluginInterface interface Drupal\search\Plugin core/modules/search/src/Plugin/ConfigurableSearchPluginInterface.php Provides an interface for a configurable Search plugin. 1
ConfigurationTest class Drupal\Tests\action\Functional core/modules/action/tests/src/Functional/ConfigurationTest.php Tests complex actions configuration.
ConfigureBlockFormBase abstract class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php Provides a base form for configuring a block. 2
ConfiguredTrait class Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php
ConfigureSectionForm class Drupal\layout_builder\Form core/modules/layout_builder/src/Form/ConfigureSectionForm.php Provides a form for configuring a layout section. 1
ConfigValidation class Drupal\config_test core/modules/config/tests/config_test/src/ConfigValidation.php Provides a collection of validation callbacks for testing purposes. 1
ConfigValidationTest class Drupal\KernelTests\Core\Recipe core/tests/Drupal/KernelTests/Core/Recipe/ConfigValidationTest.php @group Recipe
ConfigValueException class Drupal\Core\Config core/lib/Drupal/Core/Config/ConfigValueException.php Exception thrown when config object values are invalid. 2
ConfirmDeleteMultiple class Drupal\comment\Form core/modules/comment/src/Form/ConfirmDeleteMultiple.php Provides the comment multiple delete confirmation form. 1
ConfirmFormArrayPathTestForm class Drupal\form_test core/modules/system/tests/modules/form_test/src/ConfirmFormArrayPathTestForm.php Provides a test confirmation form with a complex cancellation destination. 1
ConfirmFormBase abstract class Drupal\Core\Form core/lib/Drupal/Core/Form/ConfirmFormBase.php Provides a generic base class for a confirmation form. 33 33
ConfirmFormHelper class Drupal\Core\Form core/lib/Drupal/Core/Form/ConfirmFormHelper.php Provides common functionality to confirmation forms. 3
ConfirmFormHelperTest class Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php @coversDefaultClass \Drupal\Core\Form\ConfirmFormHelper @group Form
ConfirmFormInterface interface Drupal\Core\Form core/lib/Drupal/Core/Form/ConfirmFormInterface.php Defines the behavior a confirmation form. 3 2
ConfirmFormTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/ConfirmFormTest.php Tests confirmation forms.
ConfirmFormTestForm class Drupal\form_test core/modules/system/tests/modules/form_test/src/ConfirmFormTestForm.php Provides a test confirmation form. 1 1
Connection class Drupal\driver_test\Driver\Database\DriverTestMysql core/modules/system/tests/modules/driver_test/src/Driver/Database/DriverTestMysql/Connection.php MySQL test implementation of \Drupal\Core\Database\Connection.
Connection class Drupal\driver_test\Driver\Database\DriverTestMysqlDeprecatedVersion core/modules/system/tests/modules/driver_test/src/Driver/Database/DriverTestMysqlDeprecatedVersion/Connection.php MySQL test implementation of \Drupal\Core\Database\Connection.
Connection class Drupal\driver_test\Driver\Database\DriverTestPgsql core/modules/system/tests/modules/driver_test/src/Driver/Database/DriverTestPgsql/Connection.php PostgreSQL implementation of \Drupal\Core\Database\Connection.
Connection class Drupal\pgsql\Driver\Database\pgsql core/modules/pgsql/src/Driver/Database/pgsql/Connection.php PostgreSQL implementation of \Drupal\Core\Database\Connection. 1 1
Connection class Drupal\core_fake\Driver\Database\CoreFake core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFake/Connection.php CoreFake implementation of \Drupal\Core\Database\Connection.
Connection class Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Connection.php CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Connection.
Connection class Drupal\Core\Database\Driver\CoreFake core/tests/fixtures/database_drivers/core/CoreFake/Connection.php 1 1
Connection class Drupal\Driver\Database\CoreFake core/tests/fixtures/database_drivers/custom/CoreFake/Connection.php
Connection class Drupal\Driver\Database\fake core/tests/fixtures/database_drivers/custom/fake/Connection.php A fake Connection class for testing purposes. 3 3
Connection abstract class Drupal\Core\Database core/lib/Drupal/Core/Database/Connection.php Base Database API class. 5 134
Connection class Drupal\mysql\Driver\Database\mysql core/modules/mysql/src/Driver/Database/mysql/Connection.php MySQL implementation of \Drupal\Core\Database\Connection. 2 6
Connection class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/Connection.php SQLite implementation of \Drupal\Core\Database\Connection. 6
ConnectionFailureTest class Drupal\Tests\dblog\Kernel core/modules/dblog/tests/src/Kernel/ConnectionFailureTest.php Tests logging of connection failures.
ConnectionNotDefinedException class Drupal\Core\Database core/lib/Drupal/Core/Database/ConnectionNotDefinedException.php Exception thrown if an undefined database connection is requested. 7
ConnectionTest class Drupal\Tests\Core\Database core/tests/Drupal/Tests/Core/Database/ConnectionTest.php Tests the Connection class.
ConnectionTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php Tests of the core database system.
ConnectionTest class Drupal\Tests\sqlite\Unit core/modules/sqlite/tests/src/Unit/ConnectionTest.php @coversDefaultClass \Drupal\sqlite\Driver\Database\sqlite\Connection @group Database
ConnectionTest class Drupal\Tests\mysql\Unit core/modules/mysql/tests/src/Unit/ConnectionTest.php Tests MySQL database connections.
ConnectionTest class Drupal\Tests\mysql\Kernel\mysql core/modules/mysql/tests/src/Kernel/mysql/ConnectionTest.php MySQL-specific connection tests.
ConnectionUnitTest class Drupal\Tests\mysql\Kernel\mysql core/modules/mysql/tests/src/Kernel/mysql/ConnectionUnitTest.php MySQL-specific connection unit tests.
ConnectionUnitTest class Drupal\Tests\pgsql\Kernel\pgsql core/modules/pgsql/tests/src/Kernel/pgsql/ConnectionUnitTest.php PostgreSQL-specific connection unit tests.
ConsoleInputCollector final class Drupal\Core\Recipe core/lib/Drupal/Core/Recipe/ConsoleInputCollector.php Collects input values for recipes from the command line. 1
Constraint class Drupal\Core\Validation\Attribute core/lib/Drupal/Core/Validation/Attribute/Constraint.php Defines a Constraint attribute object. 88
Constraint class Drupal\Core\Validation\Annotation core/lib/Drupal/Core/Validation/Annotation/Constraint.php Defines a validation constraint annotation object.
Constraint class Drupal\Component\Version core/lib/Drupal/Component/Version/Constraint.php A value object representing a Drupal version constraint. 3
ConstraintFactory class Drupal\Core\Validation core/lib/Drupal/Core/Validation/ConstraintFactory.php Constraint plugin factory.
ConstraintFactoryTest class Drupal\KernelTests\Core\Validation core/tests/Drupal/KernelTests/Core/Validation/ConstraintFactoryTest.php @coversDefaultClass \Drupal\Core\Validation\ConstraintFactory
ConstraintManager class Drupal\Core\Validation core/lib/Drupal/Core/Validation/ConstraintManager.php Constraint plugin manager. 8

Other projects


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