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
NodeXmlAnonTest class Drupal\Tests\node\Functional\Rest core/modules/node/tests/src/Functional/Rest/NodeXmlAnonTest.php @group rest
NodeXmlBasicAuthTest class Drupal\Tests\node\Functional\Rest core/modules/node/tests/src/Functional/Rest/NodeXmlBasicAuthTest.php @group rest
NodeXmlCookieTest class Drupal\Tests\node\Functional\Rest core/modules/node/tests/src/Functional/Rest/NodeXmlCookieTest.php @group rest
NoFieldsException class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/NoFieldsException.php Exception thrown if an insert query doesn't specify insert or default fields. 1
NoHelpTest class Drupal\Tests\help\Functional core/modules/help/tests/src/Functional/NoHelpTest.php Verify no help is displayed for modules not providing any help.
NoJavaScriptAnonymousTest class Drupal\Tests\system\Functional\Common core/modules/system/tests/src/Functional/Common/NoJavaScriptAnonymousTest.php Tests that anonymous users are not served any JavaScript.
NoLanguageEntityTest class Drupal\language_test\Entity core/modules/language/tests/language_test/src/Entity/NoLanguageEntityTest.php Defines the test entity class. 1
NoMultilingualReviewPageTest class Drupal\Tests\rdf\Functional\Migrate core/modules/rdf/tests/src/Functional/Migrate/NoMultilingualReviewPageTest.php Tests review page.
NoMultilingualReviewPageTest class Drupal\Tests\color\Functional\Migrate core/modules/color/tests/src/Functional/Migrate/NoMultilingualReviewPageTest.php Tests review page.
NoMultilingualReviewPageTest class Drupal\Tests\migrate_drupal_ui\Functional\d6 core/modules/migrate_drupal_ui/tests/src/Functional/d6/NoMultilingualReviewPageTest.php Tests migrate upgrade review page for Drupal 6 without translations.
NoMultilingualReviewPageTest class Drupal\Tests\migrate_drupal_ui\Functional\d7 core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualReviewPageTest.php Tests Drupal 7 upgrade without translations.
NoMultilingualReviewPageTest class Drupal\Tests\aggregator\Functional\migrate_drupal_ui\d6 core/modules/aggregator/tests/src/Functional/migrate_drupal_ui/d6/NoMultilingualReviewPageTest.php Tests migrate upgrade review page for Drupal 6 for the aggregator module.
NoMultilingualReviewPageTest class Drupal\Tests\aggregator\Functional\migrate_drupal_ui\d7 core/modules/aggregator/tests/src/Functional/migrate_drupal_ui/d7/NoMultilingualReviewPageTest.php Tests Drupal 7 upgrade without translations for the aggregator module.
NoMultilingualReviewPageTestBase abstract class Drupal\Tests\migrate_drupal_ui\Functional core/modules/migrate_drupal_ui/tests/src/Functional/NoMultilingualReviewPageTestBase.php Tests the upgrade review form without translations. 7 7
NonAbstractFormStateDecoratorBase class Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/FormStateDecoratorBaseTest.php Provides a non-abstract version of the class under test.
NonAnnotatedClass class Drupal\plugin_test\Plugin\plugin_test\fruit core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/fruit/NonAnnotatedClass.php
NonDefaultBlockAdminTest class Drupal\Tests\block\Functional core/modules/block/tests/src/Functional/NonDefaultBlockAdminTest.php Tests the block administration page for a non-default theme.
None class Drupal\views\Plugin\views\argument_validator core/modules/views/src/Plugin/views/argument_validator/None.php Do not validate the argument.
None class Drupal\views\Plugin\views\cache core/modules/views/src/Plugin/views/cache/None.php Caching plugin that provides no caching at all. 1
None class Drupal\views\Plugin\views\access core/modules/views/src/Plugin/views/access/None.php Access plugin that provides no access control at all.
None class Drupal\views\Plugin\views\pager core/modules/views/src/Plugin/views/pager/None.php Plugin for views without pagers. 1
NonInheritingBundleClass class Drupal\entity_test_bundle_class\Entity core/modules/system/tests/modules/entity_test_bundle_class/src/Entity/NonInheritingBundleClass.php An invalid bundle class which does not inherit the main entity class. 1
NonPrintable class Drupal\KernelTests\Core\Theme core/tests/Drupal/KernelTests/Core/Theme/ThemeRenderAndAutoescapeTest.php
NonStableModulesTest class Drupal\Tests\system\Functional\Module core/modules/system/tests/src/Functional/Module/NonStableModulesTest.php Tests the installation of deprecated and experimental modules.
NoOptimizeCacheContext class Drupal\Tests\Core\Cache\Context core/tests/Drupal/Tests/Core/Cache/Context/CacheContextsManagerTest.php Non-optimizable context class.
NoPreExistingSchemaUpdateTest class Drupal\Tests\system\Functional\UpdateSystem core/modules/system/tests/src/Functional/UpdateSystem/NoPreExistingSchemaUpdateTest.php Tries to update a module which has no pre-existing schema.
NoProfilesException class Drupal\Core\Installer\Exception core/lib/Drupal/Core/Installer/Exception/NoProfilesException.php Exception thrown if no installation profiles are available. 1
NormalInstallerServiceProvider class Drupal\Core\Installer core/lib/Drupal/Core/Installer/NormalInstallerServiceProvider.php Service provider for the installer environment. 1
NormalizerBase abstract class Drupal\hal\Normalizer core/modules/hal/src/Normalizer/NormalizerBase.php Base class for Normalizers. 2
NormalizerBase abstract class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/NormalizerBase.php Base normalizer used in all JSON:API normalizers. 10
NormalizerBase abstract class Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/NormalizerBase.php Base class for Normalizers. 13 6
NormalizerBaseTest class Drupal\Tests\serialization\Unit\Normalizer core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php @coversDefaultClass \Drupal\serialization\Normalizer\NormalizerBase[[api-linebreak]] @group serialization
NormalizerTestBase abstract class Drupal\Tests\serialization\Kernel core/modules/serialization/tests/src/Kernel/NormalizerTestBase.php Helper base class to set up some test fields for serialization testing. 4 2
NormalizerTestBase abstract class Drupal\Tests\hal\Kernel core/modules/hal/tests/src/Kernel/NormalizerTestBase.php Test the HAL normalizer. 4
NormalizeTest class Drupal\Tests\hal\Kernel core/modules/hal/tests/src/Kernel/NormalizeTest.php Tests HAL normalization edge cases for EntityResource.
NoSerializationClassTestResource class Drupal\rest_test\Plugin\rest\resource core/modules/rest/tests/modules/rest_test/src/Plugin/rest/resource/NoSerializationClassTestResource.php Class used to test that serialization_class is optional.
NoServerError class Drupal\Core\PageCache\ResponsePolicy core/lib/Drupal/Core/PageCache/ResponsePolicy/NoServerError.php A policy denying caching of a server error (HTTP 5xx) responses. 2
NoSessionOpen class Drupal\Core\PageCache\RequestPolicy core/lib/Drupal/Core/PageCache/RequestPolicy/NoSessionOpen.php A policy allowing delivery of cached pages when there is no session open. 2
NoSessionOpenTest class Drupal\Tests\Core\PageCache core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php @coversDefaultClass \Drupal\Core\PageCache\RequestPolicy\NoSessionOpen[[api-linebreak]] @group PageCache
NoSourceModule class Drupal\migration_provider_test\Plugin\migrate\source core/modules/migrate_drupal_ui/tests/modules/migration_provider_test/src/Plugin/migrate/source/NoSourceModule.php A test source plugin without a source_module.
NoSourcePluginDecorator class Drupal\migrate\Plugin core/modules/migrate/src/Plugin/NoSourcePluginDecorator.php Remove definitions which refer to a non-existing source plugin.
NotNullConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/NotNullConstraint.php NotNull constraint. 1
NotNullConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/NotNullConstraintValidator.php NotNull constraint validator.
NotRegularDirectoryException class Drupal\Core\File\Exception core/lib/Drupal/Core/File/Exception/NotRegularDirectoryException.php Exception thrown when a target is not a regular directory (e.g. a file). 1
NotRegularFileException class Drupal\Core\File\Exception core/lib/Drupal/Core/File/Exception/NotRegularFileException.php Exception thrown when a target is not a regular file (e.g. a directory). 2
NoType class Drupal\action_test\Plugin\Action core/modules/system/tests/modules/action_test/src/Plugin/Action/NoType.php Provides an operation with no type specified.
NoUniqueFieldException class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/NoUniqueFieldException.php Exception thrown if an upsert query doesn't specify a unique field.
NullArgument class Drupal\views\Plugin\views\argument core/modules/views/src/Plugin/views/argument/NullArgument.php Argument handler that ignores the argument.
NullBackend class Drupal\Core\Cache core/lib/Drupal/Core/Cache/NullBackend.php Defines a stub cache implementation. 1 10
NullBackendFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/NullBackendFactory.php 4

Other projects


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