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
StorageReplaceDataWrapperTest class Drupal\KernelTests\Core\Config\Storage core/tests/Drupal/KernelTests/Core/Config/Storage/StorageReplaceDataWrapperTest.php Tests StorageReplaceDataWrapper operations.
StorageTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/StorageTest.php Tests the UI of storage properties of views.
StorageTest class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/StorageTest.php Tests a multistep form using form storage.
StorageTestBase abstract class Drupal\KernelTests\Core\KeyValueStore core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php Base class for testing key-value storages. 3
StorageTransformerException class Drupal\Core\Config core/lib/Drupal/Core/Config/StorageTransformerException.php Thrown by config storage transformers if they cannot acquire a lock. 2
StorageTransformEvent class Drupal\Core\Config core/lib/Drupal/Core/Config/StorageTransformEvent.php Class StorageTransformEvent. 2
StreamCapturer class Drupal\Tests core/tests/Drupal/Tests/StreamCapturer.php Captures output to a stream and stores it for retrieval.
StreamFileUploaderTest class Drupal\Tests\file\Kernel\Upload core/modules/file/tests/src/Kernel/Upload/StreamFileUploaderTest.php Tests the stream file uploader.
StreamWrapperClassesPass class Drupal\Core\DependencyInjection\Compiler core/lib/Drupal/Core/DependencyInjection/Compiler/StreamWrapperClassesPass.php Collects the classes of services tagged 'stream_wrapper'. 1
StreamWrapperInterface interface Drupal\Core\StreamWrapper core/lib/Drupal/Core/StreamWrapper/StreamWrapperInterface.php Defines a Drupal stream wrapper extension. 2 14
StreamWrapperManager class Drupal\Core\StreamWrapper core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php Provides a StreamWrapper manager. 21 2
StreamWrapperManagerInterface interface Drupal\Core\StreamWrapper core/lib/Drupal/Core/StreamWrapper/StreamWrapperManagerInterface.php Provides a StreamWrapper manager. 1 26
StreamWrapperManagerTest class Drupal\KernelTests\Core\StreamWrapper core/tests/Drupal/KernelTests/Core/StreamWrapper/StreamWrapperManagerTest.php Tests Drupal\Core\StreamWrapper\StreamWrapperManager.
StreamWrapperTest class Drupal\KernelTests\Core\File core/tests/Drupal/KernelTests/Core/File/StreamWrapperTest.php Tests stream wrapper functions.
StringArgument class Drupal\views\Plugin\views\argument core/modules/views/src/Plugin/views/argument/StringArgument.php Argument handler for string. 2 2
StringBase abstract class Drupal\locale core/modules/locale/src/StringBase.php Defines the locale string base class. 2 1
StringBaseTest class Drupal\Tests\locale\Unit core/modules/locale/tests/src/Unit/StringBaseTest.php Tests Drupal\locale\StringBase.
StringData class Drupal\Core\TypedData\Plugin\DataType core/lib/Drupal/Core/TypedData/Plugin/DataType/StringData.php The string data type. 7 10 1
StringDatabaseStorage class Drupal\locale core/modules/locale/src/StringDatabaseStorage.php Defines a class to store localized strings in the database. 2
StringEqualsConcatenatedValuesConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/StringEqualsConcatenatedValuesConstraint.php Checks a string consists of specific values found in the mapping. 1
StringEqualsConcatenatedValuesConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/StringEqualsConcatenatedValuesConstraintValidator.php Validates the StringEqualsConcatenatedValues constraint. 1
StringEqualsConcatenatedValuesConstraintValidatorTest class Drupal\KernelTests\Core\Validation core/tests/Drupal/KernelTests/Core/Validation/StringEqualsConcatenatedValuesConstraintValidatorTest.php Tests the StringEqualsConcatenatedValues validator.
StringFieldTest class Drupal\Tests\field\Functional\FunctionalString core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php Tests the creation of string fields. 1 1
StringFilter class Drupal\views\Plugin\views\filter core/modules/views/src/Plugin/views/filter/StringFilter.php Basic textfield filter to handle string filtering commands. 1
StringFormatter class Drupal\Core\Field\Plugin\Field\FieldFormatter core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/StringFormatter.php Plugin implementation of the 'string' formatter. 2 2
StringFormatterTest final class Drupal\Tests\field\Unit\Plugin\Field\FieldFormatter core/modules/field/tests/src/Unit/Plugin/Field/FieldFormatter/StringFormatterTest.php Tests the string field formatter.
StringFormatterTest class Drupal\Tests\field\Kernel\KernelString core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php Tests the creation of text fields.
StringIdEntityTest class Drupal\migrate_entity_test\Entity core/modules/migrate/tests/modules/migrate_entity_test/src/Entity/StringIdEntityTest.php Defines a content entity type that has a string ID. 1
StringInterface interface Drupal\locale core/modules/locale/src/StringInterface.php Defines the locale string interface. 1 3
StringInterface interface Drupal\Core\TypedData\Type core/lib/Drupal/Core/TypedData/Type/StringInterface.php Interface for strings. 2 8
StringItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php Defines the 'string' entity field type. 8 8
StringItemBase abstract class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItemBase.php Base class for string field types. 2
StringItemTest class Drupal\Tests\Core\Field core/tests/Drupal/Tests/Core/Field/StringItemTest.php Defines a test for the StringItem field-type.
StringListField class Drupal\options\Plugin\views\argument core/modules/options/src/Plugin/views/argument/StringListField.php Argument handler for list field to show the human readable name in summary.
StringLoader class Drupal\Core\Template\Loader core/lib/Drupal/Core/Template/Loader/StringLoader.php Loads string templates, also known as inline templates. 3 2
StringLongItem class Drupal\Core\Field\Plugin\Field\FieldType core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php Defines the 'string_long' field type.
StringNormalizer class Drupal\jsonapi_test_data_type\Normalizer core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/Normalizer/StringNormalizer.php Normalizes string data weirdly: replaces 'super' with 'NOT' and vice versa. 2
StringNormalizer class Drupal\jsonapi_test_field_type\Normalizer core/modules/jsonapi/tests/modules/jsonapi_test_field_type/src/Normalizer/StringNormalizer.php Normalizes string fields weirdly: replaces 'super' with 'NOT' and vice versa. 2
StringObject class Drupal\Tests\Component\Assertion core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php Quick class for testing for objects with __toString.
StringStorageException class Drupal\locale core/modules/locale/src/StringStorageException.php Defines an exception thrown when storage operations fail. 1
StringStorageInterface interface Drupal\locale core/modules/locale/src/StringStorageInterface.php Defines the locale string storage interface. 1 6
StringTextareaWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php Plugin implementation of the 'string_textarea' widget. 1 1
StringTextfieldWidget class Drupal\Core\Field\Plugin\Field\FieldWidget core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php Plugin implementation of the 'string_textfield' widget. 2 2
StringTranslationTrait trait Drupal\Core\StringTranslation core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface. 469
StringTranslationTraitTest class Drupal\Tests\Core\StringTranslation core/tests/Drupal/Tests/Core/StringTranslation/StringTranslationTraitTest.php Tests Drupal\Core\StringTranslation\StringTranslationTrait.
StringValue class Drupal\Core\Database\SchemaDefinition core/lib/Drupal/Core/Database/SchemaDefinition/StringValue.php A class holding a string value. 12
StubCondition class Drupal\Tests\Core\Database\Stub core/tests/Drupal/Tests/Core/Database/Stub/StubCondition.php A stub of core Condition class for testing purposes. 1
StubConfigEntity class Drupal\Tests\Core\Config\Entity core/tests/Drupal/Tests/Core/Config/Entity/StubConfigEntity.php A stub extending ConfigEntityBase for testing purposes. 1
StubConnection class Drupal\Tests\Core\Database\Stub core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php A stub of the abstract Connection class for testing purposes. 8
StubControllerBase class Drupal\Tests\Core\Controller core/tests/Drupal/Tests/Core/Controller/StubControllerBase.php Stubs ControllerBase.

Other projects


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