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
EntityConstraintViolationListInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityConstraintViolationListInterface.php Interface for the result of entity validation. 1 10
EntityConstraintViolationListTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php @coversDefaultClass \Drupal\Core\Entity\EntityConstraintViolationList @group entity
EntityContentBase class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/EntityContentBase.php Provides destination class for all content entities lacking a specific class. 7 8
EntityContentBaseTest class Drupal\Tests\migrate\Unit\Plugin\migrate\destination core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php Tests base entity migration destination functionality.
EntityContentBaseTest class Drupal\Tests\migrate_drupal\Kernel\d6 core/modules/migrate_drupal/tests/src/Kernel/d6/EntityContentBaseTest.php @group migrate_drupal
EntityContentComplete class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/EntityContentComplete.php Provides a destination for migrating the entire entity revision table. 2
EntityContext class Drupal\Core\Plugin\Context core/lib/Drupal/Core/Plugin/Context/EntityContext.php Class to provide a specific entity context. 18
EntityContextDefinition class Drupal\Core\Plugin\Context core/lib/Drupal/Core/Plugin/Context/EntityContextDefinition.php Defines a class to provide entity context definitions. 16
EntityContextDefinitionIsSatisfiedTest class Drupal\Tests\Core\Plugin\Context core/tests/Drupal/Tests/Core/Plugin/Context/EntityContextDefinitionIsSatisfiedTest.php @coversDefaultClass \Drupal\Core\Plugin\Context\EntityContextDefinition @group Plugin
EntityContextTypedDataTest class Drupal\KernelTests\Core\Plugin core/tests/Drupal/KernelTests/Core/Plugin/EntityContextTypedDataTest.php Tests the interaction between entity context and typed data.
EntityController class Drupal\Core\Entity\Controller core/lib/Drupal/Core/Entity/Controller/EntityController.php Provides the add-page and title callbacks for entities. 1
EntityConverter class Drupal\Core\ParamConverter core/lib/Drupal/Core/ParamConverter/EntityConverter.php Parameter converter for upcasting entity IDs to full objects. 2 2 2
EntityConverterLatestRevisionTest class Drupal\KernelTests\Core\ParamConverter core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterLatestRevisionTest.php Tests the entity converter when the "load_latest_revision" flag is set.
EntityConverterTest class Drupal\KernelTests\Core\ParamConverter core/tests/Drupal/KernelTests/Core/ParamConverter/EntityConverterTest.php Tests the entity param converter.
EntityConverterTest class Drupal\Tests\Core\ParamConverter core/tests/Drupal/Tests/Core/ParamConverter/EntityConverterTest.php @coversDefaultClass \Drupal\Core\ParamConverter\EntityConverter @group ParamConverter @group Entity
EntityCreateAccessCheck class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityCreateAccessCheck.php Defines an access checker for entity creation. 1 2
EntityCreateAccessCheckTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityCreateAccessCheckTest.php @coversDefaultClass \Drupal\Core\Entity\EntityCreateAccessCheck
EntityCreateAnyAccessCheck class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityCreateAnyAccessCheck.php Defines an access checker for creating an entity of any bundle. 2
EntityCrudHookTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php Tests entity CRUD via hooks.
EntityDataDefinition class Drupal\Core\Entity\TypedData core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php A typed data definition class for describing entities. 5
EntityDataDefinitionInterface interface Drupal\Core\Entity\TypedData core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinitionInterface.php Interface for typed data entity definitions. 1 4
EntityDateFormat class Drupal\system\Plugin\migrate\destination core/modules/system/src/Plugin/migrate/destination/EntityDateFormat.php Plugin annotation @MigrateDestination( id = "entity:date_format" )
EntityDecoupledTranslationRevisionsTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityDecoupledTranslationRevisionsTest.php Test decoupled translation revisions.
EntityDefaultLanguageTest class Drupal\Tests\language\Kernel core/modules/language/tests/src/Kernel/EntityDefaultLanguageTest.php Tests default language code is properly generated for entities.
EntityDefinitionTestTrait trait Drupal\Tests\system\Functional\Entity\Traits core/modules/system/tests/src/Functional/Entity/Traits/EntityDefinitionTestTrait.php Provides some test methods used to update existing entity definitions. 9
EntityDefinitionUpdateManager class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php Manages entity definition updates. 2
EntityDefinitionUpdateManagerInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManagerInterface.php Defines an interface for managing entity definition updates. 1 3
EntityDefinitionUpdateTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php Tests EntityDefinitionUpdateManager functionality.
EntityDeleteActionDeriver class Drupal\Core\Action\Plugin\Action\Derivative core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityDeleteActionDeriver.php Provides an action deriver that finds entity types with delete form. 1
EntityDeleteForm class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityDeleteForm.php Provides a generic base class for an entity deletion form. 14 14
EntityDeleteFormTrait trait Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityDeleteFormTrait.php Provides a trait for an entity deletion form.
EntityDeleteMultipleAccessCheck class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityDeleteMultipleAccessCheck.php Checks if the current user has delete access to the items of the tempstore. 2
EntityDenormalizerBase abstract class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/EntityDenormalizerBase.php Converts the Drupal entity object to a JSON:API array structure. 2
EntityDeriver class Drupal\rest\Plugin\Deriver core/modules/rest/src/Plugin/Deriver/EntityDeriver.php Provides a resource plugin definition for every entity type.
EntityDeriver class Drupal\Core\Entity\Plugin\DataType\Deriver core/lib/Drupal/Core/Entity/Plugin/DataType/Deriver/EntityDeriver.php Provides data type plugins for each existing entity type and bundle.
EntityDeriverTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php Tests EntityDeriver functionality.
EntityDescriptionInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityDescriptionInterface.php Defines the interface for entities that have a description. 3 4
EntityDisplayBase abstract class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityDisplayBase.php Provides a common base class for entity view and form displays. 2 3
EntityDisplayBaseTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php @coversDefaultClass \Drupal\Core\Entity\EntityDisplayBase
EntityDisplayBaseTest class Drupal\Tests\Core\Config\Entity core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php @coversDefaultClass \Drupal\Core\Entity\EntityDisplayBase
EntityDisplayFormBase abstract class Drupal\field_ui\Form core/modules/field_ui/src/Form/EntityDisplayFormBase.php Base class for EntityDisplay edit forms. 2
EntityDisplayFormBaseTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php @coversDefaultClass \Drupal\field_ui\Form\EntityDisplayFormBase
EntityDisplayInterface interface Drupal\Core\Entity\Display core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php Provides a common interface for entity displays. 5 8
EntityDisplayModeAddForm class Drupal\field_ui\Form core/modules/field_ui/src/Form/EntityDisplayModeAddForm.php Provides the add form for entity display modes. 1
EntityDisplayModeBase abstract class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityDisplayModeBase.php Base class for config entity types with settings for form and view modes. 2 2
EntityDisplayModeBaseUnitTest class Drupal\Tests\Core\Config\Entity core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayModeBaseUnitTest.php @coversDefaultClass \Drupal\Core\Entity\EntityDisplayModeBase @group Config
EntityDisplayModeController class Drupal\field_ui\Controller core/modules/field_ui/src/Controller/EntityDisplayModeController.php Provides methods for entity display mode routes.
EntityDisplayModeDeleteForm class Drupal\field_ui\Form core/modules/field_ui/src/Form/EntityDisplayModeDeleteForm.php Provides the delete form for entity display modes.
EntityDisplayModeEditForm class Drupal\field_ui\Form core/modules/field_ui/src/Form/EntityDisplayModeEditForm.php Provides the edit form for entity display modes.
EntityDisplayModeFormBase abstract class Drupal\field_ui\Form core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php Provides the generic base class for entity display mode forms. 2

Other projects


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