Classes, traits, and interfaces - 11.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 1519

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
InvalidDecoratedMethod class Drupal\Component\Plugin\Exception core/lib/Drupal/Component/Plugin/Exception/InvalidDecoratedMethod.php Thrown when a decorator's _call() method uses a method that does not exist.
InvalidDeriverException class Drupal\Component\Plugin\Exception core/lib/Drupal/Component/Plugin/Exception/InvalidDeriverException.php Exception to be thrown if a plugin tries to use an invalid deriver. 2
InvalidEntityException final class Drupal\Core\DefaultContent core/lib/Drupal/Core/DefaultContent/InvalidEntityException.php Thrown if an entity being imported has validation errors. 1
InvalidHandler class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/TaggedHandlersPassTest.php Invalid test handler class.
InvalidLibrariesExtendSpecificationException class Drupal\Core\Asset\Exception core/lib/Drupal/Core/Asset/Exception/InvalidLibrariesExtendSpecificationException.php Defines a custom exception for an invalid libraries-extend specification. 2
InvalidLibrariesOverrideSpecificationException class Drupal\Core\Asset\Exception core/lib/Drupal/Core/Asset/Exception/InvalidLibrariesOverrideSpecificationException.php Defines a custom exception if a definition refers to a non-existent library. 3
InvalidLibraryFileException class Drupal\Core\Asset\Exception core/lib/Drupal/Core/Asset/Exception/InvalidLibraryFileException.php Defines an exception if the library file could not be parsed. 2
InvalidLinkTemplateException class Drupal\Core\Entity\Exception core/lib/Drupal/Core/Entity/Exception/InvalidLinkTemplateException.php Indicates that a link template does not follow the required pattern. 2
InvalidLookupKeyException class Drupal\Core\Config\Entity\Query core/lib/Drupal/Core/Config/Entity/Query/InvalidLookupKeyException.php Exception thrown when a config entity uses an invalid lookup key.
InvalidMergeQueryException class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/InvalidMergeQueryException.php Exception thrown for merge queries that do not make semantic sense. 1
InvalidPluginDefinitionException class Drupal\Component\Plugin\Exception core/lib/Drupal/Component/Plugin/Exception/InvalidPluginDefinitionException.php Defines a class for invalid plugin definition exceptions. 1 27
InvalidQueryException class Drupal\Core\Database core/lib/Drupal/Core/Database/InvalidQueryException.php Exception thrown if a query would be invalid. 4
InvalidStreamWrapperException class Drupal\Core\File\Exception core/lib/Drupal/Core/File/Exception/InvalidStreamWrapperException.php Exception thrown when a file's stream wrapper is invalid. 10
InvalidUpdateHookTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/InvalidUpdateHookTest.php Tests that hook_update_8000() is disallowed.
InvalidVersionIdentifierException class Drupal\jsonapi\Revisions core/modules/jsonapi/src/Revisions/InvalidVersionIdentifierException.php Used when a version ID is invalid.
InvokableUntrustedObject class Drupal\Tests\Core\Security core/tests/Drupal/Tests/Core/Security/DoTrustedCallbackTraitTest.php Invokable untrusted test class.
InvokeCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/InvokeCommand.php AJAX command for invoking an arbitrary jQuery method. 6
IpCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/IpCacheContext.php Defines the IpCacheContext service, for "per IP address" caching. 2
IsFrontPathCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/IsFrontPathCacheContext.php Defines a cache context for whether the URL is the front page of the site. 1 2
IsFrontPathCacheContextTest class Drupal\Tests\Core\Cache\Context core/tests/Drupal/Tests/Core/Cache/Context/IsFrontPathCacheContextTest.php Tests Drupal\Core\Cache\Context\IsFrontPathCacheContext.
IsNullConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/IsNullConstraint.php Null constraint.
IsNullConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/IsNullConstraintValidator.php Null constraint validator.
IsSuperUserCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/IsSuperUserCacheContext.php Defines the IsSuperUserCacheContext service, for "super user or not" caching. 2
Item class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Item.php Provides a display-only form element with an optional title and description.
ItemLayoutFieldBlockTest class Drupal\Tests\layout_builder\FunctionalJavascript core/modules/layout_builder/tests/src/FunctionalJavascript/ItemLayoutFieldBlockTest.php Field blocks tests for the override layout.
ItemList class Drupal\Core\TypedData\Plugin\DataType core/lib/Drupal/Core/TypedData/Plugin/DataType/ItemList.php A generic list class. 1 3
ItemsPerPageTest class Drupal\Tests\views\Functional\Wizard core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php Tests that the views wizard can specify the number of items per page.
JavascriptDeprecationTest class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/JavascriptDeprecationTest.php Tests Javascript deprecation notices.
JavascriptErrorsSuppressionTest class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/JavascriptErrorsSuppressionTest.php Tests that Drupal.throwError can be suppressed to allow a test to pass.
JavascriptErrorsTest class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/JavascriptErrorsTest.php Tests that Drupal.throwError will cause a test failure.
JavascriptGetDrupalSettingsTest class Drupal\FunctionalJavascriptTests core/tests/Drupal/FunctionalJavascriptTests/JavascriptGetDrupalSettingsTest.php Tests Drupal settings retrieval in WebDriverTestBase 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
JavascriptStatesTest class Drupal\FunctionalJavascriptTests\Core\Form core/tests/Drupal/FunctionalJavascriptTests/Core/Form/JavascriptStatesTest.php Tests the state of elements based on another elements.
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. 5 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 2
JoinTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/JoinTest.php Tests the join plugin.
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. 2
JqueryUiLibraryAssetsTest class Drupal\FunctionalTests\Libraries core/tests/Drupal/FunctionalTests/Libraries/JqueryUiLibraryAssetsTest.php Tests the loading of jQuery UI CSS and JS assets.
JqueryUiTestAssetsController class Drupal\jqueryui_library_assets_test\Controller core/modules/system/tests/modules/jqueryui_library_assets_test/src/Controller/JqueryUiTestAssetsController.php Controller for testing jQuery UI asset loading order.
JsAssetController class Drupal\system\Controller core/modules/system/src/Controller/JsAssetController.php Defines a controller to serve Javascript aggregates.
JsCollectionGrouper class Drupal\Core\Asset core/lib/Drupal/Core/Asset/JsCollectionGrouper.php Groups JavaScript assets. 1 2
JsCollectionOptimizerLazy class Drupal\Core\Asset core/lib/Drupal/Core/Asset/JsCollectionOptimizerLazy.php Optimizes JavaScript assets. 2
JsCollectionRenderer class Drupal\Core\Asset core/lib/Drupal/Core/Asset/JsCollectionRenderer.php Renders JavaScript assets. 2
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.
JsDeprecationTestHooks class Drupal\js_deprecation_test\Hook core/modules/system/tests/modules/js_deprecation_test/src/Hook/JsDeprecationTestHooks.php Hook implementations for js_deprecation_test.
JsDisplaceThemeHooks class Drupal\js_displace\Hook core/modules/system/tests/modules/js_displace/src/Hook/JsDisplaceThemeHooks.php Theme hook implementations for js_displace module.
JsErrorsTestController class Drupal\js_errors_test\Controller core/modules/system/tests/modules/js_errors_test/src/Controller/JsErrorsTestController.php Test Controller loading js_errors_test/errors_test library.
JSInteractionTest class Drupal\FunctionalJavascriptTests\Tests core/tests/Drupal/FunctionalJavascriptTests/Tests/JSInteractionTest.php Tests fault tolerant interactions.
JSInteractionTestForm class Drupal\js_interaction_test\Controller core/modules/system/tests/modules/js_interaction_test/src/Controller/JSInteractionTestForm.php Controller for testing fault tolerant JavaScript interactions. 1
JsMessageTest class Drupal\FunctionalJavascriptTests\Core core/tests/Drupal/FunctionalJavascriptTests/Core/JsMessageTest.php Tests core/drupal.message library. 1 1

Other projects


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