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
EntityViewDisplayHalJsonAnonTest class Drupal\Tests\hal\Functional\Core core/modules/hal/tests/src/Functional/Core/EntityViewDisplayHalJsonAnonTest.php @group hal @group legacy 3 1
EntityViewDisplayHalJsonBasicAuthTest class Drupal\Tests\hal\Functional\Core core/modules/hal/tests/src/Functional/Core/EntityViewDisplayHalJsonBasicAuthTest.php @group hal @group legacy
EntityViewDisplayHalJsonCookieTest class Drupal\Tests\hal\Functional\Core core/modules/hal/tests/src/Functional/Core/EntityViewDisplayHalJsonCookieTest.php @group hal @group legacy
EntityViewDisplayInterface interface Drupal\Core\Entity\Display core/lib/Drupal/Core/Entity/Display/EntityViewDisplayInterface.php Provides a common interface for entity view displays. 1 41
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 8 2
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
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. 23
EntityViewMode class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/EntityViewMode.php Provides entity view mode destination plugin.
EntityViewModeHalJsonAnonTest class Drupal\Tests\hal\Functional\Core core/modules/hal/tests/src/Functional/Core/EntityViewModeHalJsonAnonTest.php @group hal @group legacy
EntityViewModeHalJsonBasicAuthTest class Drupal\Tests\hal\Functional\Core core/modules/hal/tests/src/Functional/Core/EntityViewModeHalJsonBasicAuthTest.php @group hal @group legacy
EntityViewModeHalJsonCookieTest class Drupal\Tests\hal\Functional\Core core/modules/hal/tests/src/Functional/Core/EntityViewModeHalJsonCookieTest.php @group hal @group legacy
EntityViewModeInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/EntityViewModeInterface.php Provides an interface defining an entity view mode entity type. 1 3
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 9 3
EntityViewModeTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/EntityViewModeTest.php JSON:API integration test for the "EntityViewMode" config entity type.
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. 10 11
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 13
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. 6 6
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.
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. 18
EnvironmentCleaner class Drupal\Core\Test core/lib/Drupal/Core/Test/EnvironmentCleaner.php Helper class for cleaning test environments. 2
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 @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.
Error class Drupal\Core\Utility core/lib/Drupal/Core/Utility/Error.php Drupal error utility class. 13
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.
ErrorServiceTestServiceProvider class Drupal\error_service_test core/modules/system/tests/modules/error_service_test/src/ErrorServiceTestServiceProvider.php
ErrorTest class Drupal\Tests\Core\Utility core/tests/Drupal/Tests/Core/Utility/ErrorTest.php @coversDefaultClass \Drupal\Core\Utility\Error @group Utility

Other projects


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