Classes, traits, and interfaces - 8.9.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 1511

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
ItemResourceTestBase

in drupal:8.6.0 and is removed from drupal:9.0.0. Use Drupal\Tests\aggregator\Functional\Rest\ItemResourceTestBase instead.

abstract class Drupal\Tests\rest\Functional\EntityResource\Item core/modules/rest/tests/src/Functional/EntityResource/Item/ItemResourceTestBase.php
ItemsImporter class Drupal\aggregator core/modules/aggregator/src/ItemsImporter.php Defines an importer of aggregator items. 2
ItemsImporterInterface interface Drupal\aggregator core/modules/aggregator/src/ItemsImporterInterface.php Provides an interface defining an aggregator items importer. 1
ItemsPerPageTest class Drupal\Tests\views\Functional\Wizard core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php Tests the ability of the views wizard to specify the number of items per page.
ItemStorage class Drupal\aggregator core/modules/aggregator/src/ItemStorage.php Controller class for aggregators items.
ItemStorageInterface interface Drupal\aggregator core/modules/aggregator/src/ItemStorageInterface.php Defines an interface for aggregator item entity storage classes. 1 2
ItemStorageSchema class Drupal\aggregator core/modules/aggregator/src/ItemStorageSchema.php Defines the item schema handler.
ItemTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/ItemTest.php JSON:API integration test for the "Item" content entity type.
ItemViewBuilder class Drupal\aggregator core/modules/aggregator/src/ItemViewBuilder.php View builder handler for aggregator feed items.
ItemWithoutFeedTest class Drupal\Tests\aggregator\Kernel core/modules/aggregator/tests/src/Kernel/ItemWithoutFeedTest.php Tests clean handling of an item with a missing feed ID.
ItemXmlAnonTest class Drupal\Tests\aggregator\Functional\Rest core/modules/aggregator/tests/src/Functional/Rest/ItemXmlAnonTest.php @group rest
ItemXmlBasicAuthTest class Drupal\Tests\aggregator\Functional\Rest core/modules/aggregator/tests/src/Functional/Rest/ItemXmlBasicAuthTest.php @group rest
ItemXmlCookieTest class Drupal\Tests\aggregator\Functional\Rest core/modules/aggregator/tests/src/Functional/Rest/ItemXmlCookieTest.php @group rest
Iterator

in drupal:8.4.0 and is removed from drupal:9.0.0. Use \Drupal\migrate\Plugin\migrate\process\SubProcess instead.

class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/Iterator.php Iterates and processes an associative array. 1
IteratorTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/IteratorTest.php Tests the iterator process plugin.
JavascriptDeprecationTest class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php Tests Javascript deprecation notices.
JavascriptGetDrupalSettingsTest class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/JavascriptGetDrupalSettingsTest.php Tests Drupal settings retrieval in JavascriptTestBase tests.
JavascriptStatesForm class Drupal\form_test\Form core/modules/system/tests/modules/form_test/src/Form/JavascriptStatesForm.php Builds a simple form to test states. 1
JavascriptTestBase

in drupal:8.6.0 and is removed from drupal:9.0.0. Use \Drupal\FunctionalJavascriptTests\WebDriverTestBase instead

abstract class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php Runs a browser test using PhantomJS. 1
JoinPluginBase class Drupal\views\Plugin\views\join core/modules/views/src/Plugin/views/join/JoinPluginBase.php Represents a join and creates the SQL necessary to implement the join. 4 4
JoinPluginInterface interface Drupal\views\Plugin\views\join core/modules/views/src/Plugin/views/join/JoinPluginInterface.php Represents a join and creates the SQL necessary to implement the join. 1
JoinTest class Drupal\views_test_data\Plugin\views\join core/modules/views/tests/modules/views_test_data/src/Plugin/views/join/JoinTest.php Defines a join test plugin. 1
JoinTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/JoinTest.php Tests the join plugin.
JsAjaxTestCommand class Drupal\js_ajax_test\Ajax core/modules/system/tests/modules/js_ajax_test/src/Ajax/JsAjaxTestCommand.php Test Ajax command. 1
JsAjaxTestForm class Drupal\js_ajax_test\Form core/modules/system/tests/modules/js_ajax_test/src/Form/JsAjaxTestForm.php Test form for js_ajax_test 1
JsCollectionGrouper class Drupal\Core\Asset core/lib/Drupal/Core/Asset/JsCollectionGrouper.php Groups JavaScript assets. 2
JsCollectionOptimizer class Drupal\Core\Asset core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php Optimizes JavaScript assets. 2
JsCollectionRenderer class Drupal\Core\Asset core/lib/Drupal/Core/Asset/JsCollectionRenderer.php Renders JavaScript assets. 2
JsCookieTestController class Drupal\js_cookie_test\Controller core/modules/system/tests/modules/js_cookie_test/src/Controller/JsCookieTestController.php Test controller to assert js-cookie library integration.
JsDeprecationTestController class Drupal\js_deprecation_test\Controller core/modules/system/tests/modules/js_deprecation_test/src/Controller/JsDeprecationTestController.php Test Controller to show message links.
JsMessageTest class Drupal\FunctionalJavascriptTests\Core core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php Tests core/drupal.message library.
JSMessageTestController class Drupal\js_message_test\Controller core/modules/system/tests/modules/js_message_test/src/Controller/JSMessageTestController.php Test Controller to show message links. 1
Json class Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/Json.php Default serialization for JSON. 88 3
JsonApiDocumentTopLevel class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/JsonApiDocumentTopLevel.php Represents a JSON:API document's "top level". 8
JsonApiDocumentTopLevelNormalizer class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php Normalizes the top-level document according to the JSON:API specification. 1 2
JsonApiDocumentTopLevelNormalizerTest class Drupal\Tests\jsonapi\Unit\Normalizer core/modules/jsonapi/tests/src/Unit/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php @coversDefaultClass \Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer @group jsonapi
JsonApiDocumentTopLevelNormalizerTest class Drupal\Tests\jsonapi\Kernel\Normalizer core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php @coversDefaultClass \Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer @group jsonapi
JsonApiFunctionalMultilingualTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php Tests JSON:API multilingual support.
JsonApiFunctionalTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTest.php General functional test class.
JsonApiFunctionalTestBase abstract class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalTestBase.php Provides helper methods for the JSON:API module's functional tests. 3
JsonapiKernelTestBase abstract class Drupal\Tests\jsonapi\Kernel core/modules/jsonapi/tests/src/Kernel/JsonapiKernelTestBase.php Contains shared test utility methods. 9 9
JsonApiRegressionTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/JsonApiRegressionTest.php JSON:API regression tests.
JsonApiRequestTestTrait trait Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/JsonApiRequestTestTrait.php Boilerplate for JSON:API Functional tests' HTTP requests.
JsonApiRequestValidator class Drupal\jsonapi\EventSubscriber core/modules/jsonapi/src/EventSubscriber/JsonApiRequestValidator.php Request subscriber that validates a JSON:API request. 2
JsonapiServiceProvider class Drupal\jsonapi core/modules/jsonapi/src/JsonapiServiceProvider.php Adds 'api_json' as known format and prevents its use in the REST module.
JsonApiSettingsForm class Drupal\jsonapi\Form core/modules/jsonapi/src/Form/JsonApiSettingsForm.php Configure JSON:API settings for this site. 1
JsonApiSpec class Drupal\jsonapi core/modules/jsonapi/src/JsonApiSpec.php Defines constants used for compliance with the JSON:API specification. 7
JsonApiSpecTest class Drupal\Tests\jsonapi\Unit core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php @coversDefaultClass \Drupal\jsonapi\JsonApiSpec @group jsonapi
JsonEncoder class Drupal\jsonapi\Encoder core/modules/jsonapi/src/Encoder/JsonEncoder.php Encodes JSON:API data. 2
JsonEncoder class Drupal\serialization\Encoder core/modules/serialization/src/Encoder/JsonEncoder.php Adds 'ajax to the supported content types of the JSON encoder' 2 5 4

Other projects


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