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
EntityTestMultiValueBasefield class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMultiValueBasefield.php Defines an entity type with a multivalue base field. 1
EntityTestMulWithBundle class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulWithBundle.php Defines the multilingual test entity class with bundles.
EntityTestMulWithRevisionLog class Drupal\entity_test_revlog\Entity core/modules/system/tests/modules/entity_test_revlog/src/Entity/EntityTestMulWithRevisionLog.php Defines the test entity class. 1
EntityTestMulWithRevisionLogPub class Drupal\entity_test_revlog\Entity core/modules/system/tests/modules/entity_test_revlog/src/Entity/EntityTestMulWithRevisionLogPub.php Defines the test entity class.
EntityTestNew class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestNew.php Defines the test entity class for testing definition addition.
EntityTestNoBundle class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestNoBundle.php Test entity class with no bundle. 1
EntityTestNoBundleWithLabel class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestNoBundleWithLabel.php Test entity class with no bundle but with label.
EntityTestNoId class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestNoId.php Test entity class.
EntityTestNoLabel class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestNoLabel.php Test entity class. 1 2
EntityTestNoLoadStorage class Drupal\entity_test core/modules/system/tests/modules/entity_test/src/EntityTestNoLoadStorage.php Test storage class used to verify that no load operation is triggered.
EntityTestNoUuid class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestNoUuid.php Test entity class with revisions but without UUIDs. 1
EntityTestPermissions class Drupal\entity_test core/modules/system/tests/modules/entity_test/src/EntityTestPermissions.php Provides dynamic permissions for entity test.
EntityTestReferenceCustomCacheTagFormatter class Drupal\entity_test\Plugin\Field\FieldFormatter core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldFormatter/EntityTestReferenceCustomCacheTagFormatter.php Plugin implementation of the 'entity_reference_custom_cache_tag' formatter.
EntityTestResourceTestBase abstract class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestResourceTestBase.php 13 4
EntityTestRev class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRev.php Defines the test entity class. 2 14
EntityTestRevisionTest class Drupal\Tests\views\Functional\Wizard core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php Tests wizard for generic revisionable entities.
EntityTestRevPub class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestRevPub.php Defines the test entity class.
EntityTestRoutes class Drupal\entity_test\Routing core/modules/system/tests/modules/entity_test/src/Routing/EntityTestRoutes.php Subscriber for Entity Test routes.
EntityTestStringId class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestStringId.php Defines a test entity class with a string ID. 5
EntityTestTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/EntityTestTest.php JSON:API integration test for the "EntityTest" content entity type.
EntityTestTextItemNormalizerTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestTextItemNormalizerTest.php @group rest
EntityTestTranslatableNoUISkip class Drupal\content_translation_test\Entity core/modules/content_translation/tests/modules/content_translation_test/src/Entity/EntityTestTranslatableNoUISkip.php Defines the test entity class. 1
EntityTestTranslatableUISkip class Drupal\content_translation_test\Entity core/modules/content_translation/tests/modules/content_translation_test/src/Entity/EntityTestTranslatableUISkip.php Defines the test entity class. 1
EntityTestUpdate class Drupal\entity_test_update\Entity core/modules/system/tests/modules/entity_test_update/src/Entity/EntityTestUpdate.php Defines the test entity class for testing definition and schema updates. 2
EntityTestUpdateStorage class Drupal\entity_test_update core/modules/system/tests/modules/entity_test_update/src/EntityTestUpdateStorage.php Helper class for entity update testing.
EntityTestUpdateStorageSchema class Drupal\entity_test_update core/modules/system/tests/modules/entity_test_update/src/EntityTestUpdateStorageSchema.php Defines the entity_test_update storage_schema handler.
EntityTestUserClass class Drupal\entity_test_bundle_class\Entity core/modules/system/tests/modules/entity_test_bundle_class/src/Entity/EntityTestUserClass.php A custom bundle class for the User entity. 2
EntityTestVariant class Drupal\entity_test_bundle_class\Entity core/modules/system/tests/modules/entity_test_bundle_class/src/Entity/EntityTestVariant.php Defines a custom class to use for EntityTest. 2
EntityTestViewBuilder class Drupal\entity_test core/modules/system/tests/modules/entity_test/src/EntityTestViewBuilder.php Defines an entity view builder for a test entity. 1
EntityTestViewBuilder class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestViewBuilder.php Test entity class for testing a view builder.
EntityTestViewBuilderOverriddenView class Drupal\entity_test core/modules/system/tests/modules/entity_test/src/EntityTestViewBuilderOverriddenView.php Provides a view builder that overrides ::view() and ::viewMultiple().
EntityTestViewGrantsCacheContext class Drupal\entity_test\Cache core/modules/system/tests/modules/entity_test/src/Cache/EntityTestViewGrantsCacheContext.php Defines the entity_test view grants cache context service. 2
EntityTestViewsData class Drupal\entity_test core/modules/system/tests/modules/entity_test/src/EntityTestViewsData.php Provides a view to override views data for test entity types.
EntityTestViewsFieldAccessTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/EntityTestViewsFieldAccessTest.php Tests base field access in Views for the entity_test entity.
EntityTestWithBundle class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestWithBundle.php Defines the Test entity with bundle entity class. 6
EntityTestWithRevisionLog class Drupal\entity_test_revlog\Entity core/modules/system/tests/modules/entity_test_revlog/src/Entity/EntityTestWithRevisionLog.php Defines the test entity class. 2
EntityTestXmlAnonTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestXmlAnonTest.php @group rest
EntityTestXmlBasicAuthTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestXmlBasicAuthTest.php @group rest
EntityTestXmlCookieTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestXmlCookieTest.php @group rest
EntityTranslationFormTest class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityTranslationFormTest.php Tests entity translation form.
EntityTranslationNormalizeTest class Drupal\Tests\hal\Kernel core/modules/hal/tests/src/Kernel/EntityTranslationNormalizeTest.php Tests that translated nodes are correctly (de-)normalized.
EntityTranslationRendererBase abstract class Drupal\views\Entity\Render core/modules/views/src/Entity/Render/EntityTranslationRendererBase.php Defines a base class for entity translation renderers. 3
EntityTranslationRenderTrait trait Drupal\views\Entity\Render core/modules/views/src/Entity/Render/EntityTranslationRenderTrait.php Trait used to instantiate the view's entity translation renderer. 6
EntityTranslationSettings class Drupal\content_translation\Plugin\migrate\source\d7 core/modules/content_translation/src/Plugin/migrate/source/d7/EntityTranslationSettings.php Drupal 7 Entity Translation settings (variables) from database.
EntityTranslationSettingsTest class Drupal\Tests\content_translation\Kernel\Plugin\migrate\source\d7 core/modules/content_translation/tests/src/Kernel/Plugin/migrate/source/d7/EntityTranslationSettingsTest.php Tests entity translation settings source plugin.
EntityTranslationTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php Tests entity translation functionality.
EntityType class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityType.php Provides an implementation of an entity type and its metadata. 2 12
EntityType class Drupal\Core\Entity\Annotation core/lib/Drupal/Core/Entity/Annotation/EntityType.php Defines an Entity type annotation object. 2
EntityTypeBundleInfo class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityTypeBundleInfo.php Provides discovery and retrieval of entity type bundles. 1 2
EntityTypeBundleInfoInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityTypeBundleInfoInterface.php Provides an interface for an entity type bundle info. 1 59

Other projects


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