Classes, traits, and interfaces - main - 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 1529

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
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. 1
None class Drupal\views\Plugin\views\pager core/modules/views/src/Plugin/views/pager/None.php Plugin for views without pagers. 1
Nonexistent final class Drupal\Tests\Component\Annotation\Doctrine\Fixtures\Attribute core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/Attribute/Nonexistent.php #[NonexistentAttribute]
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
NonPublicSchemaTest class Drupal\Tests\pgsql\Kernel\pgsql core/modules/pgsql/tests/src/Kernel/pgsql/NonPublicSchemaTest.php Tests schema API for non-public schema for the PostgreSQL driver.
NonStableModulesTest class Drupal\Tests\system\Functional\Module core/modules/system/tests/src/Functional/Module/NonStableModulesTest.php Tests the installation of deprecated and experimental modules.
NoOpStager final class Drupal\package_manager_bypass core/modules/package_manager/tests/modules/package_manager_bypass/src/NoOpStager.php A composer-stager Stager implementation that does nothing, except logging. 2
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\serialization\Normalizer core/modules/serialization/src/Normalizer/NormalizerBase.php Base class for Normalizers. 12 5
NormalizerBase abstract class Drupal\jsonapi\Normalizer core/modules/jsonapi/src/Normalizer/NormalizerBase.php Base normalizer used in all JSON:API normalizers. 10
NormalizerBaseTest class Drupal\Tests\serialization\Unit\Normalizer core/modules/serialization/tests/src/Unit/Normalizer/NormalizerBaseTest.php Tests Drupal\serialization\Normalizer\NormalizerBase.
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. 2
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. 3
NoSessionOpenTest class Drupal\Tests\Core\PageCache core/tests/Drupal/Tests/Core/PageCache/NoSessionOpenTest.php Tests Drupal\Core\PageCache\RequestPolicy\NoSessionOpen.
NoSourceModule class Drupal\migration_source_module_test\Plugin\migrate\source core/modules/migrate_drupal_ui/tests/modules/migration_source_module_test/src/Plugin/migrate/source/NoSourceModule.php A test source plugin without a source_module.
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.
NoSourceModule class Drupal\migration_provider_test\Plugin\migrate\source core/modules/migrate_drupal/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. 1
NoSourcePluginDecoratorTest class Drupal\Tests\migrate\Unit\Plugin core/modules/migrate/tests/src/Unit/Plugin/NoSourcePluginDecoratorTest.php Tests Drupal\migrate\Plugin\NoSourcePluginDecorator.
NotATestClass class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-classes-with-metadata.php
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.
NullableSerializedItem class Drupal\entity_test\Plugin\Field\FieldType core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/NullableSerializedItem.php Defines the 'nullable_serialized_item_test' entity field type.
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 20
NullBackendFactory class Drupal\Core\Cache core/lib/Drupal/Core/Cache/NullBackendFactory.php Defines a stub cache backend factory. 2 4
NullBackendTest class Drupal\Tests\Core\Cache core/tests/Drupal/Tests/Core/Cache/NullBackendTest.php Tests the cache NullBackend.
NullCoalesce class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/NullCoalesce.php Provides a Null Coalesce process plugin. 1
NullCoalesceTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php Tests the null_coalesce process plugin.
NullDestination class Drupal\migrate\Plugin\migrate\destination core/modules/migrate/src/Plugin/migrate/destination/NullDestination.php Provides null destination plugin.
NullFileCache class Drupal\Component\FileCache core/lib/Drupal/Component/FileCache/NullFileCache.php Null implementation for the file cache. 1
NullGenerator class Drupal\Core\Routing core/lib/Drupal/Core/Routing/NullGenerator.php No-op implementation of a URL Generator, needed for backward compatibility.
NullIdMap class Drupal\migrate\Plugin\migrate\id_map core/modules/migrate/src/Plugin/migrate/id_map/NullIdMap.php Defines the null ID map implementation.
NullIncludedData class Drupal\jsonapi\JsonApiResource core/modules/jsonapi/src/JsonApiResource/NullIncludedData.php Use when there are no included resources but a Data object is required. 8
NullLockBackend class Drupal\Core\Lock core/lib/Drupal/Core/Lock/NullLockBackend.php Defines a Null lock backend. 10
NullMatcherDumper class Drupal\Core\Routing core/lib/Drupal/Core/Routing/NullMatcherDumper.php Does not dump Route information.
NullNormalizer class Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/NullNormalizer.php Null normalizer. 1 2
NullNormalizerTest class Drupal\Tests\serialization\Unit\Normalizer core/modules/serialization/tests/src/Unit/Normalizer/NullNormalizerTest.php Tests Drupal\serialization\Normalizer\NullNormalizer.
NullPathProcessorManager class Drupal\Core\PathProcessor core/lib/Drupal/Core/PathProcessor/NullPathProcessorManager.php Provides a null implementation of the path processor manager.
NullRouteMatch class Drupal\Core\Routing core/lib/Drupal/Core/Routing/NullRouteMatch.php Stub implementation of RouteMatchInterface for when there's no matched route. 2
NullStorage class Drupal\Core\Config core/lib/Drupal/Core/Config/NullStorage.php Defines a stub storage. 7

Other projects


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