Classes, traits, and interfaces - 8.9.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 1511

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
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\database_statement_monitoring_test\sqlite core/modules/system/tests/modules/database_statement_monitoring_test/src/sqlite/Connection.php SQlite Connection class that can log executed queries.
Connection class Drupal\database_statement_monitoring_test\mysql core/modules/system/tests/modules/database_statement_monitoring_test/src/mysql/Connection.php MySQL Connection class that can log executed queries.
Connection class Drupal\database_statement_monitoring_test\pgsql core/modules/system/tests/modules/database_statement_monitoring_test/src/pgsql/Connection.php PostgreSQL Connection class that can log executed queries.
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\corefake\Driver\Database\corefake core/tests/fixtures/database_drivers/module/corefake/src/Driver/Database/corefake/Connection.php
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. 2 2
Connection class Drupal\Core\Database\Driver\sqlite core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php SQLite implementation of \Drupal\Core\Database\Connection. 1 7
Connection class Drupal\Core\Database\Driver\mysql core/lib/Drupal/Core/Database/Driver/mysql/Connection.php MySQL implementation of \Drupal\Core\Database\Connection. 3 4
Connection class Drupal\Core\Database\Driver\pgsql core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php PostgreSQL implementation of \Drupal\Core\Database\Connection. 2 3
Connection abstract class Drupal\Core\Database core/lib/Drupal/Core/Database/Connection.php Base Database API class. 5 120 3
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. 5
ConnectionTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php Tests of the core database system.
ConnectionTest class Drupal\Tests\Core\Database\Driver\sqlite core/tests/Drupal/Tests/Core/Database/Driver/sqlite/ConnectionTest.php @coversDefaultClass \Drupal\Core\Database\Driver\sqlite\Connection @group Database
ConnectionTest class Drupal\Tests\Core\Database core/tests/Drupal/Tests/Core/Database/ConnectionTest.php Tests the Connection class.
ConnectionUnitTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/ConnectionUnitTest.php Tests management of database connections.
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
ConstraintManager class Drupal\Core\Validation core/lib/Drupal/Core/Validation/ConstraintManager.php Constraint plugin manager. 7 2
ConstraintsTest class Drupal\KernelTests\Core\Validation core/tests/Drupal/KernelTests/Core/Validation/ConstraintsTest.php Tests various low level constrains provided by core.
ConstraintTest class Drupal\Tests\Component\Version core/tests/Drupal/Tests/Component/Version/ConstraintTest.php @coversDefaultClass \Drupal\Component\Version\Constraint @group Version
ConstraintValidatorFactory class Drupal\Core\Validation core/lib/Drupal/Core/Validation/ConstraintValidatorFactory.php Defines a constraint validator factory that works with container injection. 1
ConstraintViolationBuilder class Drupal\Core\TypedData\Validation core/lib/Drupal/Core/TypedData/Validation/ConstraintViolationBuilder.php Defines a constraint violation builder for the Typed Data validator.
ContactCategory class Drupal\contact\Plugin\migrate\source core/modules/contact/src/Plugin/migrate/source/ContactCategory.php Contact category source from database.
ContactCategoryTest class Drupal\Tests\contact\Kernel\Plugin\migrate\source core/modules/contact/tests/src/Kernel/Plugin/migrate/source/ContactCategoryTest.php Tests D6 contact category source plugin.
ContactController class Drupal\contact\Controller core/modules/contact/src/Controller/ContactController.php Controller routines for contact routes.
ContactFieldsTest class Drupal\Tests\contact\Kernel\Views core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php Tests that no storage is created for the contact_message entity.
ContactForm class Drupal\contact\Entity core/modules/contact/src/Entity/ContactForm.php Defines the contact form entity. 13
ContactFormAccessControlHandler class Drupal\contact core/modules/contact/src/ContactFormAccessControlHandler.php Defines the access control handler for the contact form entity type.
ContactFormEditForm class Drupal\contact core/modules/contact/src/ContactFormEditForm.php Base form for contact form edit forms.
ContactFormHalJsonAnonTest class Drupal\Tests\contact\Functional\Hal core/modules/contact/tests/src/Functional/Hal/ContactFormHalJsonAnonTest.php @group hal
ContactFormHalJsonBasicAuthTest class Drupal\Tests\contact\Functional\Hal core/modules/contact/tests/src/Functional/Hal/ContactFormHalJsonBasicAuthTest.php @group hal
ContactFormHalJsonCookieTest class Drupal\Tests\contact\Functional\Hal core/modules/contact/tests/src/Functional/Hal/ContactFormHalJsonCookieTest.php @group hal
ContactFormInterface interface Drupal\contact core/modules/contact/src/ContactFormInterface.php Provides an interface defining a contact form entity. 1 4
ContactFormJsonAnonTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/ContactFormJsonAnonTest.php @group rest
ContactFormJsonBasicAuthTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/ContactFormJsonBasicAuthTest.php @group rest
ContactFormJsonCookieTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/ContactFormJsonCookieTest.php @group rest
ContactFormListBuilder class Drupal\contact core/modules/contact/src/ContactFormListBuilder.php Defines a class to build a listing of contact form entities.
ContactFormResourceTestBase abstract class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/ContactFormResourceTestBase.php 10 4
ContactFormResourceTestBase

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\contact\Functional\Rest\ContactFormResourceTestBase instead.

abstract class Drupal\Tests\rest\Functional\EntityResource\ContactForm core/modules/rest/tests/src/Functional/EntityResource/ContactForm/ContactFormResourceTestBase.php
ContactFormTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/ContactFormTest.php JSON:API integration test for the "ContactForm" config entity type.
ContactFormXmlAnonTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/ContactFormXmlAnonTest.php @group rest
ContactFormXmlBasicAuthTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/ContactFormXmlBasicAuthTest.php @group rest
ContactFormXmlCookieTest class Drupal\Tests\contact\Functional\Rest core/modules/contact/tests/src/Functional/Rest/ContactFormXmlCookieTest.php @group rest
ContactLanguageTest class Drupal\Tests\contact\Functional core/modules/contact/tests/src/Functional/ContactLanguageTest.php Tests contact messages with language module.

Other projects


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