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
EntityOperations class Drupal\workspaces core/modules/workspaces/src/EntityOperations.php Defines a class for reacting to entity events. 1
EntityOperationsTest class Drupal\Tests\content_moderation\Kernel core/modules/content_moderation/tests/src/Kernel/EntityOperationsTest.php @coversDefaultClass \Drupal\content_moderation\EntityOperations
EntityOperationsTest class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityOperationsTest.php Tests that operations can be injected from the hook.
EntityOperationsUnitTest class Drupal\Tests\views\Unit\Plugin\views\field core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php @coversDefaultClass \Drupal\views\Plugin\views\field\EntityOperations @group Views
EntityOwnerInterface interface Drupal\user core/modules/user/src/EntityOwnerInterface.php Defines a common interface for entities that have an owner. 7 16
EntityOwnerTrait trait Drupal\user core/modules/user/src/EntityOwnerTrait.php Provides a trait for entities that have an owner. 6
EntityPermissionsForm class Drupal\user\Form core/modules/user/src/Form/EntityPermissionsForm.php Provides the permissions administration form for a bundle. 1
EntityPermissionsFormTest class Drupal\Tests\user\Unit\Form core/modules/user/tests/src/Unit/Form/EntityPermissionsFormTest.php Tests the permissions administration form for a bundle.
EntityPermissionsRouteProvider class Drupal\user\Entity core/modules/user/src/Entity/EntityPermissionsRouteProvider.php Provides routes for the entity permissions form. 1
EntityPermissionsRouteProviderWithCheck class Drupal\user\Entity core/modules/user/src/Entity/EntityPermissionsRouteProviderWithCheck.php Provides routes for the entity permissions form with a custom access check.
EntityPublishedActionDeriver class Drupal\Core\Action\Plugin\Action\Derivative core/lib/Drupal/Core/Action/Plugin/Action/Derivative/EntityPublishedActionDeriver.php Provides an action deriver that finds publishable entity types. 1
EntityPublishedInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityPublishedInterface.php Provides an interface for access to an entity's published state. 11 24
EntityPublishedTrait trait Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityPublishedTrait.php Provides a trait for published status. 5
EntityQueryAccessTest class Drupal\Tests\views\Functional\Entity core/modules/views/tests/src/Functional/Entity/EntityQueryAccessTest.php Tests that Views respects 'ENTITY_TYPE_access' query tags.
EntityQueryAggregateTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityQueryAggregateTest.php Tests the Entity Query Aggregation API.
EntityQueryRelationshipTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php Tests the Entity Query relationship API.
EntityQueryTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php Tests Entity Query functionality.
EntityReference class Drupal\Core\Entity\Plugin\DataType core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php Defines an 'entity_reference' data type. 1
EntityReference class Drupal\views\Plugin\views\row core/modules/views/src/Plugin/views/row/EntityReference.php EntityReference row plugin.
EntityReference class Drupal\views\Plugin\views\display core/modules/views/src/Plugin/views/display/EntityReference.php The plugin that handles an EntityReference display.
EntityReference class Drupal\views\Plugin\views\style core/modules/views/src/Plugin/views/style/EntityReference.php EntityReference style plugin.
EntityReference class Drupal\field\Plugin\migrate\field\d7 core/modules/field/src/Plugin/migrate/field/d7/EntityReference.php MigrateField plugin for Drupal 7 entity_reference fields.
EntityReferenceAdminTest class Drupal\Tests\field\FunctionalJavascript\EntityReference core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php Tests for the administrative UI.
EntityReferenceAdminTest class Drupal\Tests\field\Functional\EntityReference core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php Tests for the administrative UI.
EntityReferenceAutocompleteTagsWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteTagsWidget.php Plugin implementation of the 'entity_reference_autocomplete_tags' widget.
EntityReferenceAutocompleteWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php Plugin implementation of the 'entity_reference_autocomplete' widget. 1
EntityReferenceAutocompleteWidgetTest class Drupal\FunctionalJavascriptTests\EntityReference core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php Tests the output of entity reference autocomplete widgets.
EntityReferenceAutoCreateTest class Drupal\Tests\field\Functional\EntityReference core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php Tests creating new entity (e.g. taxonomy-term) from an autocomplete widget.
EntityReferenceEntityFormatter class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php Plugin implementation of the 'entity reference rendered entity' formatter. 2
EntityReferenceFieldAttributesTest class Drupal\Tests\rdf\Functional core/modules/rdf/tests/src/Functional/EntityReferenceFieldAttributesTest.php Tests RDFa markup generation for taxonomy term fields.
EntityReferenceFieldCreationTest class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityReferenceFieldCreationTest.php Tests creating entity reference fields in the UI.
EntityReferenceFieldDefaultValueTest class Drupal\Tests\field\Functional\EntityReference core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php Tests entity reference field default values storage in CMI.
EntityReferenceFieldItemList class Drupal\Core\Field core/lib/Drupal/Core/Field/EntityReferenceFieldItemList.php Defines an item list class for entity reference fields. 2 3
EntityReferenceFieldItemListInterface interface Drupal\Core\Field core/lib/Drupal/Core/Field/EntityReferenceFieldItemListInterface.php Interface for entity reference lists of field items. 1 8
EntityReferenceFieldItemNormalizer class Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/EntityReferenceFieldItemNormalizer.php Adds the file URI to embedded file entities. 1 2
EntityReferenceFieldItemNormalizerTest class Drupal\Tests\serialization\Unit\Normalizer core/modules/serialization/tests/src/Unit/Normalizer/EntityReferenceFieldItemNormalizerTest.php @coversDefaultClass \Drupal\serialization\Normalizer\EntityReferenceFieldItemNormalizer @group serialization
EntityReferenceFieldItemNormalizerTrait trait Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/EntityReferenceFieldItemNormalizerTrait.php Converts empty reference values for entity reference items. 1
EntityReferenceFieldNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/EntityReferenceFieldNormalizer.php Normalizer class specific for entity reference field objects.
EntityReferenceFieldTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceFieldTest.php Tests for the entity reference field.
EntityReferenceFieldTranslatedReferenceViewTest class Drupal\Tests\field\Functional\EntityReference core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php Tests the translation of entity reference field display on nodes.
EntityReferenceFileUploadTest class Drupal\Tests\field\Functional\EntityReference core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFileUploadTest.php Tests an autocomplete widget with file upload.
EntityReferenceFormatterBase abstract class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceFormatterBase.php Parent plugin for entity reference formatters. 7 4
EntityReferenceFormatterTest class Drupal\Tests\field\Kernel\EntityReference core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php Tests the formatters functionality.
EntityReferenceIdFormatter class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceIdFormatter.php Plugin implementation of the 'entity reference ID' formatter.
EntityReferenceIntegrationTest class Drupal\Tests\field\Functional\EntityReference core/modules/field/tests/src/Functional/EntityReference/EntityReferenceIntegrationTest.php Tests various Entity reference UI components.
EntityReferenceItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php Defines the 'entity_reference' entity field type. 2 16
EntityReferenceItemNormalizer class Drupal\hal\Normalizer core/modules/hal/src/Normalizer/EntityReferenceItemNormalizer.php Converts the Drupal entity reference item object to HAL array structure. 2
EntityReferenceItemSubclass class Drupal\media_library_test\Plugin\Field\FieldType core/modules/media_library/tests/modules/media_library_test/src/Plugin/Field/FieldType/EntityReferenceItemSubclass.php Plugin implementation of the 'entity_reference_subclass' field type.
EntityReferenceItemTest class Drupal\Tests\field\Kernel\EntityReference core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php Tests the new entity API for the entity reference field type.
EntityReferenceLabelFormatter class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php Plugin implementation of the 'entity reference label' formatter.

Other projects


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