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
EntityReferenceRdfaTest class Drupal\Tests\rdf\Kernel\Field core/modules/rdf/tests/src/Kernel/Field/EntityReferenceRdfaTest.php Tests the RDFa output of the entity reference field formatter.
EntityReferenceRelationshipTest class Drupal\Tests\field\Kernel\EntityReference\Views core/modules/field/tests/src/Kernel/EntityReference/Views/EntityReferenceRelationshipTest.php Tests entity reference relationship data.
EntityReferenceSelection class Drupal\Core\Entity\Annotation core/lib/Drupal/Core/Entity/Annotation/EntityReferenceSelection.php Defines an EntityReferenceSelection plugin annotation object.
EntityReferenceSelectionAccessTest class Drupal\Tests\system\Functional\Entity\EntityReferenceSelection core/modules/system/tests/src/Functional/Entity/EntityReferenceSelection/EntityReferenceSelectionAccessTest.php Tests for the base handlers provided by Entity Reference.
EntityReferenceSelectionReferenceableTest class Drupal\Tests\system\Kernel\Entity core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php Tests entity reference selection plugins.
EntityReferenceSelectionSortTest class Drupal\KernelTests\Core\Entity\EntityReferenceSelection core/tests/Drupal/KernelTests/Core/Entity/EntityReferenceSelection/EntityReferenceSelectionSortTest.php Tests sorting referenced items.
EntityReferenceSettingsTest class Drupal\Tests\field\Kernel\EntityReference core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php Tests entity reference field settings.
EntityReferenceSupportedNewEntitiesConstraint class Drupal\workspaces\Plugin\Validation\Constraint core/modules/workspaces/src/Plugin/Validation/Constraint/EntityReferenceSupportedNewEntitiesConstraint.php The entity reference supported new entities constraint.
EntityReferenceSupportedNewEntitiesConstraintValidator class Drupal\workspaces\Plugin\Validation\Constraint core/modules/workspaces/src/Plugin/Validation/Constraint/EntityReferenceSupportedNewEntitiesConstraintValidator.php Checks if new entities created for entity reference fields are supported.
EntityReferenceSupportedNewEntitiesConstraintValidatorTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/EntityReferenceSupportedNewEntitiesConstraintValidatorTest.php @coversDefaultClass \Drupal\workspaces\Plugin\Validation\Constraint\EntityReferenceSupportedNewEntitiesConstraintValidator @group workspaces
EntityReferenceTaxonomyTermRssFormatter class Drupal\taxonomy\Plugin\Field\FieldFormatter core/modules/taxonomy/src/Plugin/Field/FieldFormatter/EntityReferenceTaxonomyTermRssFormatter.php Plugin implementation of the 'entity reference taxonomy term RSS' formatter.
EntityReferenceTestTrait trait Drupal\Tests\field\Traits core/modules/field/tests/src/Traits/EntityReferenceTestTrait.php Provides common functionality for the EntityReference test classes. 46
EntityReferenceTranslationDeriver class Drupal\migrate_drupal\Plugin\migrate core/modules/migrate_drupal/src/Plugin/migrate/EntityReferenceTranslationDeriver.php Deriver for entity reference field translations. 2
EntityReferenceWidgetTest class Drupal\Tests\media_library\FunctionalJavascript core/modules/media_library/tests/src/FunctionalJavascript/EntityReferenceWidgetTest.php Tests the Media library entity reference widget.
EntityReferenceXSSTest class Drupal\Tests\field\Functional\EntityReference core/modules/field/tests/src/Functional/EntityReference/EntityReferenceXSSTest.php Tests possible XSS security issues in entity references.
EntityRepository class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityRepository.php Provides several mechanisms for retrieving entities. 1 2
EntityRepositoryInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityRepositoryInterface.php Provides an interface for an entity repository. 1 62
EntityRepositoryTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityRepositoryTest.php @coversDefaultClass \Drupal\Core\Entity\EntityRepository @group Entity
EntityRepositoryTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityRepositoryTest.php Tests the entity repository.
EntityResolverInterface interface Drupal\serialization\EntityResolver core/modules/serialization/src/EntityResolver/EntityResolverInterface.php 3 1
EntityResolverManager class Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityResolverManager.php Sets the entity route parameter converter options automatically. 2 2
EntityResolverManagerTest class Drupal\Tests\Core\Entity core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php @coversDefaultClass \Drupal\Core\Entity\EntityResolverManager @group Entity
EntityResolverTest class Drupal\Tests\hal\Kernel core/modules/hal/tests/src/Kernel/EntityResolverTest.php Tests that entities references can be resolved.
EntityResource class Drupal\rest\Plugin\rest\resource core/modules/rest/src/Plugin/rest/resource/EntityResource.php Represents entities as resources. 1 1
EntityResource class Drupal\jsonapi\Controller core/modules/jsonapi/src/Controller/EntityResource.php Process all entity requests. 2
EntityResourceAccessTrait trait Drupal\rest\Plugin\rest\resource core/modules/rest/src/Plugin/rest/resource/EntityResourceAccessTrait.php @internal @todo Consider making public in https://www.drupal.org/node/2300677 1
EntityResourceHalTestCoverageTest class Drupal\Tests\hal\Kernel\EntityResource core/modules/hal/tests/src/Kernel/EntityResource/EntityResourceHalTestCoverageTest.php Checks that all core content/config entity types have HAL test coverage.
EntityResourcePostRouteSubscriber class Drupal\rest\EventSubscriber core/modules/rest/src/EventSubscriber/EntityResourcePostRouteSubscriber.php Generates a 'create' route for an entity type if it has a REST POST route. 2
EntityResourceRestTestCoverageTest class Drupal\Tests\rest\Kernel\EntityResource core/modules/rest/tests/src/Kernel/EntityResource/EntityResourceRestTestCoverageTest.php Checks that all core content/config entity types have REST test coverage.
EntityResourceTest class Drupal\Tests\jsonapi\Kernel\Controller core/modules/jsonapi/tests/src/Kernel/Controller/EntityResourceTest.php @coversDefaultClass \Drupal\jsonapi\Controller\EntityResource @group jsonapi
EntityResourceTestBase abstract class Drupal\Tests\rest\Functional\EntityResource core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php Defines a base class for testing all entity resources. 14 13
EntityResourceValidationTrait trait Drupal\rest\Plugin\rest\resource core/modules/rest/src/Plugin/rest/resource/EntityResourceValidationTrait.php @internal @todo Consider making public in https://www.drupal.org/node/2300677 3
EntityResourceValidationTraitTest class Drupal\Tests\rest\Unit core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php @group rest @coversDefaultClass \Drupal\rest\Plugin\rest\resource\EntityResourceValidationTrait
EntityResourceValidationTraitTestClass class Drupal\Tests\rest\Unit core/modules/rest/tests/src/Unit/EntityResourceValidationTraitTest.php A test class to use to test EntityResourceValidationTrait.
EntityReverse class Drupal\views\Plugin\views\relationship core/modules/views/src/Plugin/views/relationship/EntityReverse.php A relationship handlers which reverse entity references.
EntityRevision class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/EntityRevision.php Provides entity revision destination plugin. 2 2
EntityRevision class Drupal\Tests\migrate\Unit\destination core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php Mock that exposes from internal methods for testing.
EntityRevisionParamConverter class Drupal\Core\ParamConverter core/lib/Drupal/Core/ParamConverter/EntityRevisionParamConverter.php Parameter converter for upcasting entity revision IDs to full objects. 1 2
EntityRevisionParamConverterTest class Drupal\Tests\Core\ParamConverter core/tests/Drupal/Tests/Core/ParamConverter/EntityRevisionParamConverterTest.php @coversDefaultClass \Drupal\Core\ParamConverter\EntityRevisionParamConverter @group entity
EntityRevisionRouteEnhancer class Drupal\Core\Routing\Enhancer core/lib/Drupal/Core/Routing/Enhancer/EntityRevisionRouteEnhancer.php Adds _entity_revision to the request attributes, if possible. 1 2
EntityRevisionRouteEnhancerTest class Drupal\Tests\Core\Enhancer core/tests/Drupal/Tests/Core/Enhancer/EntityRevisionRouteEnhancerTest.php @coversDefaultClass \Drupal\Core\Routing\Enhancer\EntityRevisionRouteEnhancer @group Entity
EntityRevisionsTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionsTest.php Tests the loaded Revision of an entity.
EntityRevisionsTest class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php Tests modifying an entity with revisions.
EntityRevisionTest class Drupal\Tests\migrate\Unit\destination core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php Tests entity revision destination.
EntityRevisionTest class Drupal\Tests\migrate\Unit\Plugin\migrate\destination core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php Tests entity revision destination functionality.
EntityRevisionTest class Drupal\Tests\migrate\Kernel\Plugin core/modules/migrate/tests/src/Kernel/Plugin/EntityRevisionTest.php Tests the EntityRevision destination plugin.
EntityRevisionTestDestination class Drupal\Tests\migrate\Unit\Plugin\migrate\destination core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php Stub class for testing EntityRevision methods.
EntityRevisionTranslationTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php Tests proper revision propagation of entities.
EntityRouteAlterSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php Registers the 'type' of route parameter names that match an entity type. 2
EntityRouteEnhancer class Drupal\Core\Entity\Enhancer core/lib/Drupal/Core/Entity/Enhancer/EntityRouteEnhancer.php Enhances an entity form route with the appropriate controller. 1 2

Other projects


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