Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
EntityTypeWithoutViewsDataTest class Drupal\Tests\datetime_range\Kernel\Views core/modules/datetime_range/tests/src/Kernel/Views/EntityTypeWithoutViewsDataTest.php Tests datetime_range.module when an entity type provides no views data.
EntityUnitTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php Tests Drupal\Core\Entity\EntityBase.
EntityUntranslatableFieldsConstraint class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityUntranslatableFieldsConstraint.php Validation constraint for the entity changed timestamp.
EntityUntranslatableFieldsConstraintValidator class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityUntranslatableFieldsConstraintValidator.php Validates the EntityChanged constraint.
EntityUpdateInitialTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/EntityUpdateInitialTest.php Tests handling of existing initial keys during updates.
EntityUpdateTest class Drupal\Tests\editor\Kernel core/modules/editor/tests/src/Kernel/EntityUpdateTest.php Tests updating an entity.
EntityUrlLanguageTest class Drupal\Tests\language\Kernel core/modules/language/tests/src/Kernel/EntityUrlLanguageTest.php Tests the language of entity URLs.
EntityUrlTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityUrlTest.php Tests URL handling of the \Drupal\Core\Entity\EntityBase class.
EntityUser class Drupal\user\Plugin\migrate\destination core/modules/user/src/Plugin/migrate/destination/EntityUser.php Provides a destination plugin for migrating user entities.
EntityUserRole

in drupal:11.3.0 and is removed from drupal:12.0.0. There is no replacement.

class Drupal\user\Plugin\migrate\destination core/modules/user/src/Plugin/migrate/destination/EntityUserRole.php Provides a destination plugin for migrating user role entities.
EntityUuidConverter class Drupal\jsonapi\ParamConverter core/modules/jsonapi/src/ParamConverter/EntityUuidConverter.php Parameter converter for upcasting entity UUIDs to full objects. 2
EntityUuidIdTest class Drupal\FunctionalTests\Entity core/tests/Drupal/FunctionalTests/Entity/EntityUuidIdTest.php Tests that an entity with a UUID as ID can be managed.
EntityUUIDTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php Tests creation, saving, and loading of entity UUIDs.
EntityValidationException class Drupal\migrate\Exception core/modules/migrate/src/Exception/EntityValidationException.php To throw when an entity generated during the import is not valid. 1
EntityValidationTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityValidationTest.php Tests the Entity Validation API.
EntityValidationTrait trait Drupal\jsonapi\Entity core/modules/jsonapi/src/Entity/EntityValidationTrait.php Provides a method to validate an entity. 2
EntityViewAlterTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/EntityViewAlterTest.php Tests Entity View Alter.
EntityViewBuilder class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityViewBuilder.php Base class for entity view builders. 7 11
EntityViewBuilderInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityViewBuilderInterface.php Defines an interface for entity view builders. 1 2
EntityViewBuilderTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityViewBuilderTest.php Tests the entity view builder.
EntityViewBuilderTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityViewBuilderTest.php Tests Drupal\Core\Entity\EntityViewBuilder.
EntityViewController class Drupal\Core\Entity\Controller core/lib/Drupal/Core/Entity/Controller/EntityViewController.php Defines a generic controller to render a single entity. 2 2
EntityViewControllerTest class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityViewControllerTest.php Tests EntityViewController functionality.
EntityViewDisplay class Drupal\layout_builder_override\Entity core/modules/layout_builder/tests/modules/layout_builder_override/src/Entity/EntityViewDisplay.php Stub class to evaluate the override. 1
EntityViewDisplay class Drupal\Core\Entity\Entity core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php Configuration entity. 2 68
EntityViewDisplayAccessControlHandler class Drupal\Core\Entity\Entity\Access core/lib/Drupal/Core/Entity/Entity/Access/EntityViewDisplayAccessControlHandler.php Provides an entity access control handler for displays. 2
EntityViewDisplayAccessControlHandlerTest class Drupal\Tests\Core\Entity\Access core/tests/Drupal/Tests/Core/Entity/Access/EntityViewDisplayAccessControlHandlerTest.php Tests Drupal\Core\Entity\Entity\Access\EntityViewDisplayAccessControlHandler.
EntityViewDisplayEditForm class Drupal\field_ui\Form core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php Edit form for the EntityViewDisplay entity type. 1 2
EntityViewDisplayInterface interface Drupal\Core\Entity\Display core/lib/Drupal/Core/Entity/Display/EntityViewDisplayInterface.php Provides a common interface for entity view displays. 2 33
EntityViewDisplayJsonAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayJsonAnonTest.php Tests Entity View Display Json Anon.
EntityViewDisplayJsonBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayJsonBasicAuthTest.php Tests Entity View Display Json Basic Auth.
EntityViewDisplayJsonCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayJsonCookieTest.php Tests Entity View Display Json Cookie.
EntityViewDisplayResourceTestBase abstract class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayResourceTestBase.php Resource test base for the entity_view_display entity. 7 1
EntityViewDisplayTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/EntityViewDisplayTest.php JSON:API integration test for the "EntityViewDisplay" config entity type. 1 1
EntityViewDisplayValidationTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityViewDisplayValidationTest.php Tests validation of entity_view_display entities.
EntityViewDisplayXmlAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayXmlAnonTest.php Tests Entity View Display Xml Anon.
EntityViewDisplayXmlBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayXmlBasicAuthTest.php Tests Entity View Display Xml Basic Auth.
EntityViewDisplayXmlCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayXmlCookieTest.php Tests Entity View Display Xml Cookie.
EntityViewHookTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityViewHookTest.php Test view/render hooks for entities.
EntityViewMode class Drupal\Core\Entity\Entity core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php Defines the entity view mode configuration entity class. 32
EntityViewMode class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php Provides entity view mode destination plugin.
EntityViewModeInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityViewModeInterface.php Provides an interface defining an entity view mode entity type. 1 4
EntityViewModeJsonAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeJsonAnonTest.php Tests Entity View Mode Json Anon.
EntityViewModeJsonBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeJsonBasicAuthTest.php Tests Entity View Mode Json Basic Auth.
EntityViewModeJsonCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeJsonCookieTest.php Tests Entity View Mode Json Cookie.
EntityViewModeResourceTestBase abstract class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeResourceTestBase.php Resource test base for the entity_view_mode entity. 6
EntityViewModeTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/EntityViewModeTest.php JSON:API integration test for the "EntityViewMode" config entity type.
EntityViewModeValidationTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityViewModeValidationTest.php Tests validation of entity_view_mode entities.
EntityViewModeXmlAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeXmlAnonTest.php Tests Entity View Mode Xml Anon.
EntityViewModeXmlBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeXmlBasicAuthTest.php Tests Entity View Mode Xml Basic Auth.

Other projects


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