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
EntityRouteEnhancerTest class Drupal\Tests\Core\Entity\Enhancer core/tests/Drupal/Tests/Core/Entity/Enhancer/EntityRouteEnhancerTest.php @coversDefaultClass \Drupal\Core\Entity\Enhancer\EntityRouteEnhancer @group Entity
EntityRouteProviderInterface interface Drupal\Core\Entity\Routing core/lib/Drupal/Core/Entity/Routing/EntityRouteProviderInterface.php Allows entity types to provide routes. 5 4
EntityRouteProviderSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/EntityRouteProviderSubscriber.php Ensures that routes can be provided by entity types. 2
EntityRow class Drupal\views\Plugin\views\row core/modules/views/src/Plugin/views/row/EntityRow.php Generic entity row plugin to provide a common base for all entity types. 2 2
EntitySavedCommand class Drupal\quickedit\Ajax core/modules/quickedit/src/Ajax/EntitySavedCommand.php Indicates the entity was loaded from PrivateTempStore and saved. 1
EntitySchemaSubscriber class Drupal\entity_test_update\EventSubscriber core/modules/system/tests/modules/entity_test_update/src/EventSubscriber/EntitySchemaSubscriber.php Defines a class for listening to entity schema changes. 2
EntitySchemaSubscriber class Drupal\workspaces\EventSubscriber core/modules/workspaces/src/EventSubscriber/EntitySchemaSubscriber.php Defines a class for listening to entity schema changes. 2
EntitySchemaTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php Tests the default entity storage schema handler.
EntitySearchPage class Drupal\search\Plugin\migrate\destination core/modules/search/src/Plugin/migrate/destination/EntitySearchPage.php Migrate destination for search page.
EntitySerializationTest class Drupal\Tests\serialization\Kernel core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php Tests that entities can be serialized to supported core formats.
EntitySerializedField class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntitySerializedField.php Defines a test class for testing fields with a serialized column. 2
EntityShortcutSet class Drupal\shortcut\Plugin\migrate\destination core/modules/shortcut/src/Plugin/migrate/destination/EntityShortcutSet.php Plugin annotation @MigrateDestination( id = "entity:shortcut_set" )
EntityStateChangeValidationTest class Drupal\Tests\content_moderation\Kernel core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php @coversDefaultClass \Drupal\content_moderation\Plugin\Validation\Constraint\ModerationStateConstraintValidator @group content_moderation
EntityStorageBase abstract class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityStorageBase.php A base entity storage class. 3 2
EntityStorageBaseTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityStorageBaseTest.php @coversDefaultClass \Drupal\Core\Entity\EntityStorageBase @group Entity
EntityStorageDeprecationTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityStorageDeprecationTest.php @coversDefaultClass \Drupal\Core\Entity\EntityStorageBase @group Entity @group legacy
EntityStorageException class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityStorageException.php Defines an exception thrown when storage operations fail. 2 29
EntityStorageInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityStorageInterface.php Defines the interface for entity storage classes. 7 141
EntityStorageSchemaInterface interface Drupal\Core\Entity\Schema core/lib/Drupal/Core/Entity/Schema/EntityStorageSchemaInterface.php Defines the interface for entity storage schema handler classes. 1 1
EntityTest class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php Defines the test entity class. 32 156
EntityTest class Drupal\Tests\views\Unit\Plugin\argument_validator core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php @coversDefaultClass \Drupal\views\Plugin\views\argument_validator\Entity @group views
EntityTest class Drupal\Tests\views\Unit\Plugin\area core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php @coversDefaultClass \Drupal\views\Plugin\views\area\Entity @group Entity
EntityTestAccessControlHandler class Drupal\entity_test core/modules/system/tests/modules/entity_test/src/EntityTestAccessControlHandler.php Defines the access control handler for the test entity type.
EntityTestAdminRoutes class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestAdminRoutes.php Defines a test entity type with administrative routes. 1
EntityTestAmbiguousBundleClass class Drupal\entity_test_bundle_class\Entity core/modules/system/tests/modules/entity_test_bundle_class/src/Entity/EntityTestAmbiguousBundleClass.php An ambiguous bundle class that is a subclass of two different entity classes. 2
EntityTestBase class Drupal\Tests\migrate\Unit\Plugin\migrate\destination core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityTestBase.php Base test class for entity migration destination functionality. 2
EntityTestBaseFieldDisplay class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBaseFieldDisplay.php Defines a test entity class for base fields display. 2
EntityTestBundle class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBundle.php Defines the Test entity bundle configuration entity. 13
EntityTestBundleClass class Drupal\entity_test_bundle_class\Entity core/modules/system/tests/modules/entity_test_bundle_class/src/Entity/EntityTestBundleClass.php The bundle class for the bundle_class bundle of the entity_test entity. 2
EntityTestBundleHalJsonAnonTest class Drupal\Tests\hal\Functional\entity_test core/modules/hal/tests/src/Functional/entity_test/EntityTestBundleHalJsonAnonTest.php @group hal @group legacy
EntityTestBundleHalJsonBasicAuthTest class Drupal\Tests\hal\Functional\entity_test core/modules/hal/tests/src/Functional/entity_test/EntityTestBundleHalJsonBasicAuthTest.php @group hal @group legacy
EntityTestBundleHalJsonCookieTest class Drupal\Tests\hal\Functional\entity_test core/modules/hal/tests/src/Functional/entity_test/EntityTestBundleHalJsonCookieTest.php @group hal @group legacy
EntityTestBundleJsonAnonTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleJsonAnonTest.php @group rest
EntityTestBundleJsonBasicAuthTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleJsonBasicAuthTest.php @group rest
EntityTestBundleJsonCookieTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleJsonCookieTest.php @group rest
EntityTestBundleResourceTestBase abstract class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleResourceTestBase.php 9 3
EntityTestBundleXmlAnonTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleXmlAnonTest.php @group rest
EntityTestBundleXmlBasicAuthTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleXmlBasicAuthTest.php @group rest
EntityTestBundleXmlCookieTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleXmlCookieTest.php @group rest
EntityTestCache class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCache.php Defines the test entity class.
EntityTestCompositeConstraint class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestCompositeConstraint.php Defines a test class for testing composite constraints. 1
EntityTestCompositeConstraint class Drupal\entity_test\Plugin\Validation\Constraint core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php Constraint with multiple fields. 1
EntityTestCompositeConstraintValidator class Drupal\entity_test\Plugin\Validation\Constraint core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraintValidator.php Constraint validator for the EntityTestComposite constraint.
EntityTestComputedField class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestComputedField.php An entity used for testing computed field values. 4
EntityTestComputedFieldNormalizerTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestComputedFieldNormalizerTest.php Test normalization of computed field.
EntityTestComputedFieldTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/EntityTestComputedFieldTest.php JSON:API integration test for the "EntityTestComputedField" content entity type.
EntityTestConstraints class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestConstraints.php Defines a test class for testing the definition of entity level constraints. 1
EntityTestConstraintViolation class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestConstraintViolation.php Defines the test entity class for testing entity constraint violations.
EntityTestContainerFactoryPlugin class Drupal\entity_test\Plugin\Validation\Constraint core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestContainerFactoryPlugin.php A dummy constraint for testing \Drupal\Core\Validation\ConstraintFactory.
EntityTestController class Drupal\entity_test\Controller core/modules/system/tests/modules/entity_test/src/Controller/EntityTestController.php Controller routines for entity_test routes.

Other projects


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