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
EntitySchemaTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php Tests the default entity storage schema handler.
EntitySchemaTestHooks class Drupal\entity_schema_test\Hook core/modules/system/tests/modules/entity_schema_test/src/Hook/EntitySchemaTestHooks.php Hook implementations for entity_schema_test.
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.
EntitySerializationTestHooks class Drupal\entity_serialization_test\Hook core/modules/serialization/tests/modules/entity_serialization_test/src/Hook/EntitySerializationTestHooks.php Hook implementations for entity_serialization_test.
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. 1
EntityShortcutSet

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

class Drupal\shortcut\Plugin\migrate\destination core/modules/shortcut/src/Plugin/migrate/destination/EntityShortcutSet.php Migration destination for shortcut set entity.
EntityStateChangeValidationTest class Drupal\Tests\content_moderation\Kernel core/modules/content_moderation/tests/src/Kernel/EntityStateChangeValidationTest.php Tests Drupal\content_moderation\Plugin\Validation\Constraint\ModerationStateConstraintValidator.
EntityStorageBase abstract class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityStorageBase.php A base entity storage class. 4 4
EntityStorageBaseTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityStorageBaseTest.php Tests Drupal\Core\Entity\EntityStorageBase.
EntityStorageException class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityStorageException.php Defines an exception thrown when storage operations fail. 2 31
EntityStorageInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityStorageInterface.php Defines the interface for entity storage classes. 6 150
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
EntityTaxonomyVocabulary class Drupal\taxonomy\Plugin\migrate\destination core/modules/taxonomy/src/Plugin/migrate/destination/EntityTaxonomyVocabulary.php Migration destination for taxonomy vocabulary.
EntityTest class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTest.php Defines the test entity class. 43 176
EntityTest class Drupal\Tests\views\Unit\Plugin\argument_validator core/modules/views/tests/src/Unit/Plugin/argument_validator/EntityTest.php Tests Drupal\views\Plugin\views\argument_validator\Entity.
EntityTest class Drupal\Tests\views\Unit\Plugin\area core/modules/views/tests/src/Unit/Plugin/area/EntityTest.php Tests Drupal\views\Plugin\views\area\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. 24
EntityTestAddPage class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestAddPage.php Test entity class routes.
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
EntityTestAttributeBundleClassHooks class Drupal\entity_test_attribute_bundle_class\Hook core/modules/system/tests/modules/entity_test_attribute_bundle_class/src/Hook/EntityTestAttributeBundleClassHooks.php Hook implementations for entity_test_attribute_bundle_class.
EntityTestBase abstract 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. 3
EntityTestBlock class Drupal\entity_test\Plugin\Block core/modules/system/tests/modules/entity_test/src/Plugin/Block/EntityTestBlock.php Provides a block that renders an entity with parallel placeholder rendering.
EntityTestBundle class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestBundle.php Defines the Test entity bundle configuration entity. 28
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
EntityTestBundleClassA class Drupal\entity_test_attribute_bundle_class\Entity core/modules/system/tests/modules/entity_test_attribute_bundle_class/src/Entity/EntityTestBundleClassA.php The bundle class for the bundle_class_a bundle of the entity_test entity. 1
EntityTestBundleClassB class Drupal\entity_test_attribute_bundle_class\Entity core/modules/system/tests/modules/entity_test_attribute_bundle_class/src/Entity/EntityTestBundleClassB.php The bundle class for the bundle_class_b bundle of the entity_test entity. 1
EntityTestBundleClassHooks class Drupal\entity_test_bundle_class\Hook core/modules/system/tests/modules/entity_test_bundle_class/src/Hook/EntityTestBundleClassHooks.php Hook implementations for entity_test_bundle_class.
EntityTestBundleClassOverrideA class Drupal\entity_test_attribute_bundle_class\Entity core/modules/system/tests/modules/entity_test_attribute_bundle_class/src/Entity/EntityTestBundleClassOverrideA.php Overrides bundle class for the entity_test entity type bundle_class_a bundle. 1
EntityTestBundleClassOverrideB class Drupal\entity_test_attribute_bundle_class\Entity core/modules/system/tests/modules/entity_test_attribute_bundle_class/src/Entity/EntityTestBundleClassOverrideB.php Overrides bundle class for the entity_test entity type bundle_class_b bundle. 1
EntityTestBundleJsonAnonTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleJsonAnonTest.php Tests EntityTest Bundle Json Anon.
EntityTestBundleJsonBasicAuthTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleJsonBasicAuthTest.php Tests EntityTest Bundle Json Basic Auth.
EntityTestBundleJsonCookieTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleJsonCookieTest.php Tests EntityTest Bundle Json Cookie.
EntityTestBundleResourceTestBase abstract class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleResourceTestBase.php Resource test base for the EntityTestBundle entity. 6
EntityTestBundleXmlAnonTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleXmlAnonTest.php Tests EntityTest Bundle Xml Anon.
EntityTestBundleXmlBasicAuthTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleXmlBasicAuthTest.php Tests EntityTest Bundle Xml Basic Auth.
EntityTestBundleXmlCookieTest class Drupal\Tests\entity_test\Functional\Rest core/modules/system/tests/modules/entity_test/tests/src/Functional/Rest/EntityTestBundleXmlCookieTest.php Tests EntityTest Bundle Xml Cookie Auth.
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.
EntityTestComputedBundleField class Drupal\entity_test\Entity core/modules/system/tests/modules/entity_test/src/Entity/EntityTestComputedBundleField.php An entity used for testing computed bundle field values. 1
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. 6
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
EntityTestConstraintsHooks class Drupal\entity_test_constraints\Hook core/modules/system/tests/modules/entity_test_constraints/src/Hook/EntityTestConstraintsHooks.php Hook implementations for entity_test_constraints.
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.

Other projects


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