Classes, traits, and interfaces - 10.3.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
EntityFormDisplayXmlBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityFormDisplayXmlBasicAuthTest.php @group rest
EntityFormDisplayXmlCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityFormDisplayXmlCookieTest.php @group rest
EntityFormInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityFormInterface.php Defines an interface for entity form classes. 4 4
EntityFormMode class Drupal\Core\Entity\Entity core/lib/Drupal/Core/Entity/Entity/EntityFormMode.php Defines the entity form mode configuration entity class. 14
EntityFormModeAddForm class Drupal\field_ui\Form core/modules/field_ui/src/Form/EntityFormModeAddForm.php Provides the add form for entity display modes.
EntityFormModeInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityFormModeInterface.php Provides an interface defining an entity form mode entity type. 1 4
EntityFormModeJsonAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityFormModeJsonAnonTest.php @group rest
EntityFormModeJsonBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityFormModeJsonBasicAuthTest.php @group rest
EntityFormModeJsonCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityFormModeJsonCookieTest.php @group rest
EntityFormModeListBuilder class Drupal\field_ui core/modules/field_ui/src/EntityFormModeListBuilder.php Defines a class to build a listing of form mode entities.
EntityFormModeResourceTestBase abstract class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityFormModeResourceTestBase.php 6
EntityFormModeTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/EntityFormModeTest.php JSON:API integration test for the "EntityFormMode" config entity type.
EntityFormModeValidationTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityFormModeValidationTest.php Tests validation of entity_form_mode entities.
EntityFormModeXmlAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityFormModeXmlAnonTest.php @group rest
EntityFormModeXmlBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityFormModeXmlBasicAuthTest.php @group rest
EntityFormModeXmlCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityFormModeXmlCookieTest.php @group rest
EntityFormTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php @coversDefaultClass \Drupal\Core\Entity\EntityForm[[api-linebreak]] @group Entity
EntityFormTest class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityFormTest.php Tests the entity form.
EntityHandlerBase abstract class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityHandlerBase.php Provides a base class for entity handlers. 7 1
EntityHandlerInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityHandlerInterface.php Defines an interface for entity handlers. 19 16
EntityHasFieldConstraint class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityHasFieldConstraint.php Checks if a value is an entity that has a specific field.
EntityHasFieldConstraintValidator class Drupal\Core\Entity\Plugin\Validation\Constraint core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/EntityHasFieldConstraintValidator.php Validates the EntityHasField constraint.
EntityHasFieldConstraintValidatorTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php @covers \Drupal\Core\Entity\Plugin\Validation\Constraint\EntityHasFieldConstraintValidator[[api-linebreak]]
EntityImageStyle class Drupal\image\Plugin\migrate\destination core/modules/image/src/Plugin/migrate/destination/EntityImageStyle.php Entity image style destination.
EntityInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityInterface.php Defines a common interface for all entity objects. 11 317
EntityKernelTestBase abstract class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBase.php Defines an abstract test base for entity kernel tests. 81 39
EntityKernelTestBaseTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityKernelTestBaseTest.php @covers \Drupal\KernelTests\Core\Entity\EntityKernelTestBase[[api-linebreak]]
EntityKeysTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityKeysTest.php Test the behavior of entity keys.
EntityLabel class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/EntityLabel.php Field handler to display entity label optionally linked to entity page.
EntityLabelTest class Drupal\Tests\system\Kernel\Entity core/modules/system/tests/src/Kernel/Entity/EntityLabelTest.php Tests that entity type labels use sentence-case.
EntityLanguageTestBase abstract class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityLanguageTestBase.php Base class for language-aware entity tests. 3
EntityLastInstalledSchemaRepository class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepository.php Provides a repository for installed entity definitions. 2
EntityLastInstalledSchemaRepositoryInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityLastInstalledSchemaRepositoryInterface.php Provides an interface for an installed entity definition repository. 1 8
EntityLink class Drupal\comment\Plugin\views\field core/modules/comment/src/Plugin/views/field/EntityLink.php Handler for showing comment module's entity links. 1
EntityLink class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/EntityLink.php Field handler to present a link to an entity. 3 1
EntityLinkDelete class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/EntityLinkDelete.php Field handler to present a link to delete an entity.
EntityLinkEdit class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/EntityLinkEdit.php Field handler to present a link to edit an entity.
EntityLinkTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php @coversDefaultClass \Drupal\Core\Entity\EntityBase[[api-linebreak]] @group Entity
EntityLinkTest class Drupal\Tests\comment\Unit\Plugin\views\field core/modules/comment/tests/src/Unit/Plugin/views/field/EntityLinkTest.php @coversDefaultClass \Drupal\comment\Plugin\views\field\EntityLink[[api-linebreak]] @group comment
EntityListBuilder class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityListBuilder.php Defines a generic implementation to build a listing of entities. 9 11
EntityListBuilderInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityListBuilderInterface.php Defines an interface to build entity listings. 2 1
EntityListBuilderTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php @coversDefaultClass \Drupal\Core\Entity\EntityListBuilder[[api-linebreak]] @group Entity
EntityListBuilderTest class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityListBuilderTest.php Tests entity list builder functionality.
EntityListController class Drupal\Core\Entity\Controller core/lib/Drupal/Core/Entity/Controller/EntityListController.php Defines a generic controller to list entities. 2 2
EntityLoadByUuidTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityLoadByUuidTest.php Tests loading entities by UUID.
EntityMalformedException class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityMalformedException.php Defines an exception thrown when a malformed entity is passed. 10
EntityMethod final class Drupal\Core\Config\Action\Plugin\ConfigAction core/lib/Drupal/Core/Config/Action/Plugin/ConfigAction/EntityMethod.php Makes config entity methods with the ActionMethod attribute into actions.
EntityMethodConfigActionsTest class Drupal\KernelTests\Core\Recipe core/tests/Drupal/KernelTests/Core/Recipe/EntityMethodConfigActionsTest.php @group Recipe
EntityMethodDeriver final class Drupal\Core\Config\Action\Plugin\ConfigAction\Deriver core/lib/Drupal/Core/Config/Action/Plugin/ConfigAction/Deriver/EntityMethodDeriver.php Derives config action methods from attributed config entity methods. 1
EntityMethodException final class Drupal\Core\Config\Action core/lib/Drupal/Core/Config/Action/EntityMethodException.php @internal This API is experimental. 3

Other projects


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