Classes, traits, and interfaces - 10.3.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 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
EntityViewDisplayAccessControlHandler class Drupal\Core\Entity\Entity\Access core/lib/Drupal/Core/Entity/Entity/Access/EntityViewDisplayAccessControlHandler.php Provides an entity access control handler for displays. 1
EntityViewDisplayAccessControlHandlerTest class Drupal\Tests\Core\Entity\Access core/tests/Drupal/Tests/Core/Entity/Access/EntityViewDisplayAccessControlHandlerTest.php @coversDefaultClass \Drupal\Core\Entity\Entity\Access\EntityViewDisplayAccessControlHandler[[api-linebreak]] @group Entity
EntityViewDisplayEditForm class Drupal\field_ui\Form core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php Edit form for the EntityViewDisplay entity type. 2 3
EntityViewDisplayInterface interface Drupal\Core\Entity\Display core/lib/Drupal/Core/Entity/Display/EntityViewDisplayInterface.php Provides a common interface for entity view displays. 1 47
EntityViewDisplayJsonAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayJsonAnonTest.php @group rest
EntityViewDisplayJsonBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayJsonBasicAuthTest.php @group rest
EntityViewDisplayJsonCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayJsonCookieTest.php @group rest
EntityViewDisplayResourceTestBase abstract class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayResourceTestBase.php 7 1
EntityViewDisplayTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/EntityViewDisplayTest.php JSON:API integration test for the "EntityViewDisplay" config entity type. 1 1
EntityViewDisplayValidationTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityViewDisplayValidationTest.php Tests validation of entity_view_display entities.
EntityViewDisplayXmlAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayXmlAnonTest.php @group rest
EntityViewDisplayXmlBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayXmlBasicAuthTest.php @group rest
EntityViewDisplayXmlCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayXmlCookieTest.php @group rest
EntityViewHookTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityViewHookTest.php Test view/render hooks for entities.
EntityViewMode class Drupal\Core\Entity\Entity core/lib/Drupal/Core/Entity/Entity/EntityViewMode.php Defines the entity view mode configuration entity class. 29
EntityViewMode class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php Provides entity view mode destination plugin.
EntityViewModeInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityViewModeInterface.php Provides an interface defining an entity view mode entity type. 1 5
EntityViewModeJsonAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeJsonAnonTest.php @group rest
EntityViewModeJsonBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeJsonBasicAuthTest.php @group rest
EntityViewModeJsonCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeJsonCookieTest.php @group rest
EntityViewModeResourceTestBase abstract class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeResourceTestBase.php 6
EntityViewModeTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/EntityViewModeTest.php JSON:API integration test for the "EntityViewMode" config entity type.
EntityViewModeValidationTest class Drupal\KernelTests\Core\Entity core/tests/Drupal/KernelTests/Core/Entity/EntityViewModeValidationTest.php Tests validation of entity_view_mode entities.
EntityViewModeXmlAnonTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeXmlAnonTest.php @group rest
EntityViewModeXmlBasicAuthTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeXmlBasicAuthTest.php @group rest
EntityViewModeXmlCookieTest class Drupal\FunctionalTests\Rest core/tests/Drupal/FunctionalTests/Rest/EntityViewModeXmlCookieTest.php @group rest
EntityViewsData class Drupal\views core/modules/views/src/EntityViewsData.php Provides generic views integration for entities. 8 9
EntityViewsDataInterface interface Drupal\views core/modules/views/src/EntityViewsDataInterface.php Provides an interface to integrate an entity type with views. 2 1
EntityViewsDataTest class Drupal\Tests\views\Kernel\Entity core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php Tests entity views data.
EntityViewsWithMultivalueBasefieldTest class Drupal\Tests\views\Kernel\Entity core/modules/views/tests/src/Kernel/Entity/EntityViewsWithMultivalueBasefieldTest.php Tests entity views with multivalue base fields.
EntityViewTrait trait Drupal\Tests core/tests/Drupal/Tests/EntityViewTrait.php Provides helper methods to deal with building entity views in tests. 4
EntityWithPluginCollectionInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityWithPluginCollectionInterface.php Provides an interface for an object using a plugin collection. 10 14
EntityWithUriCacheTagsTestBase abstract class Drupal\Tests\system\Functional\Entity core/modules/system/tests/src/Functional/Entity/EntityWithUriCacheTagsTestBase.php Provides helper methods for Entity cache tags tests; for entities with URIs. 5 5
EntityWorkspaceConflictConstraint class Drupal\workspaces\Plugin\Validation\Constraint core/modules/workspaces/src/Plugin/Validation/Constraint/EntityWorkspaceConflictConstraint.php Validation constraint for an entity being edited in multiple workspaces. 1
EntityWorkspaceConflictConstraintValidator class Drupal\workspaces\Plugin\Validation\Constraint core/modules/workspaces/src/Plugin/Validation/Constraint/EntityWorkspaceConflictConstraintValidator.php Validates the EntityWorkspaceConflict constraint.
EntityWorkspaceConflictConstraintValidatorTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/EntityWorkspaceConflictConstraintValidatorTest.php @coversDefaultClass \Drupal\workspaces\Plugin\Validation\Constraint\EntityWorkspaceConflictConstraintValidator[[api-linebreak]] @group workspaces
EntryPoint class Drupal\jsonapi\Controller core/modules/jsonapi/src/Controller/EntryPoint.php Controller for the API entry point. 1
EntryPointTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/EntryPointTest.php Makes assertions about the JSON:API behavior for internal entities.
Environment class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Environment.php Provides PHP environment helper methods. 15
EnvironmentCleaner class Drupal\Core\Test core/lib/Drupal/Core/Test/EnvironmentCleaner.php Helper class for cleaning test environments. 1
EnvironmentCleanerInterface interface Drupal\Core\Test core/lib/Drupal/Core/Test/EnvironmentCleanerInterface.php Defines an interface for cleaning up test results and fixtures. 1
EnvironmentCleanerTest class Drupal\KernelTests\Core\Test core/tests/Drupal/KernelTests/Core/Test/EnvironmentCleanerTest.php @coversDefaultClass \Drupal\Core\Test\EnvironmentCleaner[[api-linebreak]] @group Test
EnvironmentTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/EnvironmentTest.php Test PHP Environment helper methods.
Equality class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/Equality.php Simple filter to handle equal to / not equal to filters.
EquivalentUpdate final class Drupal\Core\Update core/lib/Drupal/Core/Update/EquivalentUpdate.php Value object to hold information about an equivalent update. 2
EquivalentUpdateTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/EquivalentUpdateTest.php Tests that update hooks are properly run.
Error class Drupal\Core\Utility core/lib/Drupal/Core/Utility/Error.php Drupal error utility class. 30
ErrorCollection class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/ErrorCollection.php To be used when the primary data is `errors`. 4
ErrorContainer class Drupal\FunctionalTests\Bootstrap core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php Container base class which triggers an error.
ErrorHandlerTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/ErrorHandlerTest.php Performs tests on the Drupal error and exception handler.

Other projects


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