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
ResourceTest class Drupal\Tests\media\Unit core/modules/media/tests/src/Unit/ResourceTest.php @coversDefaultClass \Drupal\media\OEmbed\Resource[[api-linebreak]] @group media
ResourceTestBase abstract class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/ResourceTestBase.php Subclass this for every JSON:API resource type. 18 3
ResourceTestBase abstract class Drupal\Tests\rest\Functional core/modules/rest/tests/src/Functional/ResourceTestBase.php Subclass this for every REST resource, every format and every auth provider. 7 6
ResourceType class Drupal\jsonapi\ResourceType core/modules/jsonapi/src/ResourceType/ResourceType.php Value object containing all metadata for a JSON:API resource type. 1 28
ResourceTypeAttribute class Drupal\jsonapi\ResourceType core/modules/jsonapi/src/ResourceType/ResourceTypeAttribute.php Specialization of a ResourceTypeField to represent a resource type attribute.
ResourceTypeBuildEvent class Drupal\jsonapi\ResourceType core/modules/jsonapi/src/ResourceType/ResourceTypeBuildEvent.php An event used to configure the construction of a JSON:API resource type. 1
ResourceTypeBuildEvents final class Drupal\jsonapi\ResourceType core/modules/jsonapi/src/ResourceType/ResourceTypeBuildEvents.php Contains all events emitted during the resource type build process. 1
ResourceTypeBuildEventSubscriber class Drupal\jsonapi_test_resource_type_building\EventSubscriber core/modules/jsonapi/tests/modules/jsonapi_test_resource_type_building/src/EventSubscriber/ResourceTypeBuildEventSubscriber.php Event subscriber which tests disabling resource types. 2
ResourceTypeConverter class Drupal\jsonapi\ParamConverter core/modules/jsonapi/src/ParamConverter/ResourceTypeConverter.php Parameter converter for upcasting JSON:API resource type names to objects. 1 2
ResourceTypeField abstract class Drupal\jsonapi\ResourceType core/modules/jsonapi/src/ResourceType/ResourceTypeField.php Abstract value object containing all metadata for a JSON:API resource field. 2 1
ResourceTypeRelationship class Drupal\jsonapi\ResourceType core/modules/jsonapi/src/ResourceType/ResourceTypeRelationship.php Specialization of a ResourceTypeField to represent a resource relationship. 4
ResourceTypeRepository class Drupal\jsonapi\ResourceType core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php Provides a repository of all JSON:API resource types. 2 5 2
ResourceTypeRepositoryInterface interface Drupal\jsonapi\ResourceType core/modules/jsonapi/src/ResourceType/ResourceTypeRepositoryInterface.php Provides a repository of all JSON:API resource types. 1 7
ResourceTypeRepositoryTest class Drupal\Tests\jsonapi\Kernel\ResourceType core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php @coversDefaultClass \Drupal\jsonapi\ResourceType\ResourceTypeRepository[[api-linebreak]] @group jsonapi
ResourceVersionRouteEnhancer final class Drupal\jsonapi\Revisions core/modules/jsonapi/src/Revisions/ResourceVersionRouteEnhancer.php Loads an appropriate revision for the requested resource version. 1 2
ResponseDisplayPluginInterface interface Drupal\views\Plugin\views\display core/modules/views/src/Plugin/views/display/ResponseDisplayPluginInterface.php Defines a display which returns a Response object. 2 1
ResponseGeneratorSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/ResponseGeneratorSubscriber.php Response subscriber to add X-Generator header tag. 2
ResponseGeneratorTest class Drupal\Tests\system\Functional\System core/modules/system/tests/src/Functional/System/ResponseGeneratorTest.php Tests to see if generator header is added.
ResponsePolicyInterface interface Drupal\Core\PageCache core/lib/Drupal/Core/PageCache/ResponsePolicyInterface.php Defines the interface for response policy implementations. 7 12
ResponseTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/ResponseTest.php Tests the form API Response element.
ResponsiveImage class Drupal\responsive_image\Element core/modules/responsive_image/src/Element/ResponsiveImage.php Provides a responsive image element.
ResponsiveImageAdminUITest class Drupal\Tests\responsive_image\Functional core/modules/responsive_image/tests/src/Functional/ResponsiveImageAdminUITest.php Thoroughly test the administrative interface of the Responsive Image module.
ResponsiveImageFieldDisplayTest class Drupal\Tests\responsive_image\Functional core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php Tests responsive image display formatter.
ResponsiveImageFieldUiTest class Drupal\Tests\responsive_image\FunctionalJavascript core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php Tests the responsive image field UI.
ResponsiveImageFormatter class Drupal\responsive_image\Plugin\Field\FieldFormatter core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php Plugin for responsive image formatter. 1 2
ResponsiveImageIntegrationTest class Drupal\Tests\responsive_image\Kernel core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php Tests the integration of responsive image with other components.
ResponsiveImageStyle class Drupal\responsive_image\Entity core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php Defines the responsive image style entity. 10
ResponsiveImageStyleConfigEntityUnitTest class Drupal\Tests\responsive_image\Unit core/modules/responsive_image/tests/src/Unit/ResponsiveImageStyleConfigEntityUnitTest.php @coversDefaultClass \Drupal\responsive_image\Entity\ResponsiveImageStyle[[api-linebreak]] @group block
ResponsiveImageStyleForm class Drupal\responsive_image core/modules/responsive_image/src/ResponsiveImageStyleForm.php Form controller for the responsive image edit/add forms.
ResponsiveImageStyleHalJsonAnonTest class Drupal\Tests\hal\Functional\responsive_image core/modules/hal/tests/src/Functional/responsive_image/ResponsiveImageStyleHalJsonAnonTest.php @group hal @group legacy
ResponsiveImageStyleHalJsonBasicAuthTest class Drupal\Tests\hal\Functional\responsive_image core/modules/hal/tests/src/Functional/responsive_image/ResponsiveImageStyleHalJsonBasicAuthTest.php @group hal @group legacy
ResponsiveImageStyleHalJsonCookieTest class Drupal\Tests\hal\Functional\responsive_image core/modules/hal/tests/src/Functional/responsive_image/ResponsiveImageStyleHalJsonCookieTest.php @group hal @group legacy
ResponsiveImageStyleInterface interface Drupal\responsive_image core/modules/responsive_image/src/ResponsiveImageStyleInterface.php Provides an interface defining a responsive_image mapping entity. 1 4
ResponsiveImageStyleJsonAnonTest class Drupal\Tests\responsive_image\Functional\Rest core/modules/responsive_image/tests/src/Functional/Rest/ResponsiveImageStyleJsonAnonTest.php @group rest
ResponsiveImageStyleJsonBasicAuthTest class Drupal\Tests\responsive_image\Functional\Rest core/modules/responsive_image/tests/src/Functional/Rest/ResponsiveImageStyleJsonBasicAuthTest.php @group rest
ResponsiveImageStyleJsonCookieTest class Drupal\Tests\responsive_image\Functional\Rest core/modules/responsive_image/tests/src/Functional/Rest/ResponsiveImageStyleJsonCookieTest.php @group rest
ResponsiveImageStyleListBuilder class Drupal\responsive_image core/modules/responsive_image/src/ResponsiveImageStyleListBuilder.php Provides a listing of responsive image styles.
ResponsiveImageStyleResourceTestBase abstract class Drupal\Tests\responsive_image\Functional\Rest core/modules/responsive_image/tests/src/Functional/Rest/ResponsiveImageStyleResourceTestBase.php ResourceTestBase for ResponsiveImageStyle entity. 9 3
ResponsiveImageStyles class Drupal\responsive_image\Plugin\migrate\source\d7 core/modules/responsive_image/src/Plugin/migrate/source/d7/ResponsiveImageStyles.php Gets Drupal responsive image styles source from database.
ResponsiveImageStylesTest class Drupal\Tests\responsive_image\Kernel\Plugin\migrate\source\d7 core/modules/responsive_image/tests/src/Kernel/Plugin/migrate/source/d7/ResponsiveImageStylesTest.php Tests D7 responsive image styles source plugin.
ResponsiveImageStyleTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/ResponsiveImageStyleTest.php JSON:API integration test for the "ResponsiveImageStyle" config entity type.
ResponsiveImageStyleXmlAnonTest class Drupal\Tests\responsive_image\Functional\Rest core/modules/responsive_image/tests/src/Functional/Rest/ResponsiveImageStyleXmlAnonTest.php @group rest
ResponsiveImageStyleXmlBasicAuthTest class Drupal\Tests\responsive_image\Functional\Rest core/modules/responsive_image/tests/src/Functional/Rest/ResponsiveImageStyleXmlBasicAuthTest.php @group rest
ResponsiveImageStyleXmlCookieTest class Drupal\Tests\responsive_image\Functional\Rest core/modules/responsive_image/tests/src/Functional/Rest/ResponsiveImageStyleXmlCookieTest.php @group rest
ResponsiveImageTestFormatter class Drupal\responsive_image_test_module\Plugin\Field\FieldFormatter core/modules/responsive_image/tests/modules/responsive_image_test_module/src/Plugin/Field/FieldFormatter/ResponsiveImageTestFormatter.php Plugin to test responsive image formatter.
RestExport class Drupal\rest\Plugin\views\display core/modules/rest/src/Plugin/views/display/RestExport.php The plugin that handles Data response callbacks for REST resources. 3
RestExportAuthTest class Drupal\Tests\rest\Functional\Views core/modules/rest/tests/src/Functional/Views/RestExportAuthTest.php Tests authentication for REST display.
RestExportJsonApiUnsupported class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/RestExportJsonApiUnsupported.php Ensures that the 'api_json' format is not supported by the REST module.
RestExportTest class Drupal\Tests\rest\Kernel\Views core/modules/rest/tests/src/Kernel/Views/RestExportTest.php Tests the REST export view display plugin.
RestJsonApiUnsupported class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/RestJsonApiUnsupported.php Ensures that the 'api_json' format is not supported by the REST module.

Other projects


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