Classes, traits, and interfaces - 10.3.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 1518

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
NullHelpAndDescriptionTest class Drupal\Tests\node\Functional\Update core/modules/node/tests/src/Functional/Update/NullHelpAndDescriptionTest.php Tests the upgrade path for making content types' help and description NULL.
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. 7
NullLockBackend class Drupal\Core\Lock core/lib/Drupal/Core/Lock/NullLockBackend.php Defines a Null lock backend. 9
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 @coversDefaultClass \Drupal\serialization\Normalizer\NullNormalizer[[api-linebreak]] @group serialization
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. 1
NullStorage class Drupal\Core\Config core/lib/Drupal/Core/Config/NullStorage.php Defines a stub storage. 5
NullStorageExpirable class Drupal\Core\KeyValueStore core/lib/Drupal/Core/KeyValueStore/NullStorageExpirable.php Defines a null key/value store implementation.
NullStorageTest class Drupal\Tests\Core\Config core/tests/Drupal/Tests/Core/Config/NullStorageTest.php Tests the NullStorage.
NullTestImageEffect class Drupal\image_module_test\Plugin\ImageEffect core/modules/image/tests/modules/image_module_test/src/Plugin/ImageEffect/NullTestImageEffect.php Performs no operation on an image resource.
Number class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Number.php Provides helper methods for manipulating numbers. 3
Number class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Number.php Provides a form element for numeric input, with special numeric validation. 1 1
NumberField class Drupal\field\Plugin\migrate\field\d7 core/modules/field/src/Plugin/migrate/field/d7/NumberField.php MigrateField plugin for Drupal 7 number fields.
NumberFieldTest class Drupal\Tests\field\FunctionalJavascript\Number core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php Tests the numeric field widget.
NumberFieldTest class Drupal\Tests\field\Functional\Number core/modules/field/tests/src/Functional/Number/NumberFieldTest.php Tests the creation of numeric fields.
NumberItemTest class Drupal\Tests\field\Kernel\Number core/modules/field/tests/src/Kernel/Number/NumberItemTest.php Tests the new entity API for the number field type.
NumberListField class Drupal\options\Plugin\views\argument core/modules/options/src/Plugin/views/argument/NumberListField.php Argument handler for list field to show human readable name in the summary.
NumberTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/NumberTest.php Tests number manipulation utilities.
NumberWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php Plugin implementation of the 'number' widget.
NumericArgument class Drupal\views\Plugin\views\argument core/modules/views/src/Plugin/views/argument/NumericArgument.php Basic argument handler for arguments that are numeric. 4 2
NumericArgumentValidator class Drupal\views\Plugin\views\argument_validator core/modules/views/src/Plugin/views/argument_validator/NumericArgumentValidator.php Validate whether an argument is numeric or not.
NumericField class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/NumericField.php Render a field as a numeric value. 3 4
NumericFilter class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/NumericFilter.php Simple filter to handle greater than/less than filters. 2 2
NumericFilterTest class Drupal\Tests\views\Unit\Plugin\views\filter core/modules/views/tests/src/Unit/Plugin/views/filter/NumericFilterTest.php @coversDefaultClass \Drupal\views\Plugin\views\filter\NumericFilter[[api-linebreak]] @group Views
NumericFormatPluralTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/NumericFormatPluralTest.php Tests the creation of numeric fields.
NumericFormatterBase abstract class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php Parent plugin for decimal and integer formatters. 2
NumericItemBase abstract class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/NumericItemBase.php Base class for numeric configurable field types. 3 1
NumericUnformattedFormatter class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericUnformattedFormatter.php Plugin implementation of the 'number_unformatted' formatter. 1 1
ObjectAwareSerializationInterface interface Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/ObjectAwareSerializationInterface.php Ensures that a serializer is usable for serializing PHP objects. 1 2
ObjectDefinition class Drupal\Tests\Core\Plugin core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
ObjectDefinition class Drupal\Tests\Component\Annotation\Plugin\Discovery core/tests/Drupal/Tests/Component/Annotation/Plugin/Discovery/AnnotationBridgeDecoratorTest.php
ObjectDefinition class Drupal\Tests\Component\Plugin\Discovery core/tests/Drupal/Tests/Component/Plugin/Discovery/AttributeBridgeDecoratorTest.php
ObjectSerialization class Drupal\Core\Test core/lib/Drupal/Core/Test/ObjectSerialization.php Object to test that security issues around serialization.
ObjectWithPluginCollectionInterface interface Drupal\Core\Plugin core/lib/Drupal/Core/Plugin/ObjectWithPluginCollectionInterface.php Provides an interface for an object using a plugin collection. 1 1
ObjWithString class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/LogTest.php Test class with a __toString() method.
ObsoleteExtensionException class Drupal\Core\Extension\Exception core/lib/Drupal/Core/Extension/Exception/ObsoleteExtensionException.php Exception thrown when the extension is obsolete on install. 2
OEmbed class Drupal\media\Plugin\media\Source core/modules/media/src/Plugin/media/Source/OEmbed.php Provides a media source plugin for oEmbed resources. 1
OEmbedDeriver class Drupal\media\Plugin\media\Source core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php Derives media source plugin definitions for supported oEmbed providers.
OEmbedFieldWidgetTest class Drupal\Tests\media\Functional\FieldWidget core/modules/media/tests/src/Functional/FieldWidget/OEmbedFieldWidgetTest.php @covers \Drupal\media\Plugin\Field\FieldWidget\OEmbedWidget[[api-linebreak]]
OEmbedForm class Drupal\media_library\Form core/modules/media_library/src/Form/OEmbedForm.php Creates a form to create media entities from oEmbed URLs. 2
OEmbedFormatter class Drupal\media\Plugin\Field\FieldFormatter core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php Plugin implementation of the 'oembed' formatter.
OEmbedFormatterTest class Drupal\Tests\media\Functional\FieldFormatter core/modules/media/tests/src/Functional/FieldFormatter/OEmbedFormatterTest.php @covers \Drupal\media\Plugin\Field\FieldFormatter\OEmbedFormatter[[api-linebreak]]
OEmbedIframeController class Drupal\media\Controller core/modules/media/src/Controller/OEmbedIframeController.php Controller which renders an oEmbed resource in a bare page (without blocks). 1
OEmbedIframeControllerTest class Drupal\Tests\media\Kernel core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php @coversDefaultClass \Drupal\media\Controller\OEmbedIframeController[[api-linebreak]]
OEmbedInterface interface Drupal\media\Plugin\media\Source core/modules/media/src/Plugin/media/Source/OEmbedInterface.php Defines additional functionality for source plugins that use oEmbed. 1 6
OEmbedMediaSource class Drupal\media\Attribute core/modules/media/src/Attribute/OEmbedMediaSource.php Defines a OEmbedMediaSource attribute. 1
OEmbedResourceConstraint class Drupal\media\Plugin\Validation\Constraint core/modules/media/src/Plugin/Validation/Constraint/OEmbedResourceConstraint.php Checks if a value represents a valid oEmbed resource URL. 1

Other projects


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