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
SetterInjection class Drupal\new_dependency_test core/modules/system/tests/modules/new_dependency_test/src/SetterInjection.php Generic service which uses setter injection. 2
Settings final class Drupal\admin core/themes/admin/src/Settings.php Service to handle overridden user settings. 3
Settings final class Drupal\default_admin core/themes/default_admin/src/Settings.php Service to handle overridden user settings. 3
Settings final class Drupal\Core\Site core/lib/Drupal/Core/Site/Settings.php Read only settings that are initialized with the class. 151 2
SettingsAnnotation class Drupal\Tests\Component\Annotation\Doctrine core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php
SettingsCommand class Drupal\Core\Ajax core/lib/Drupal/Core/Ajax/SettingsCommand.php AJAX command for adjusting Drupal's JavaScript settings. 3
SettingsConfigValidationTest class Drupal\Tests\image\Kernel core/modules/image/tests/src/Kernel/SettingsConfigValidationTest.php Tests Settings Config Validation.
SettingsEditor final class Drupal\Core\Site core/lib/Drupal/Core/Site/SettingsEditor.php Generates settings.php files for Drupal installations. 3
SettingsForm class Drupal\media_library\Form core/modules/media_library/src/Form/SettingsForm.php Defines a form for configuring the Media Library module. 1 1
SettingsForm final class Drupal\navigation\Form core/modules/navigation/src/Form/SettingsForm.php Configure Navigation settings for this site. 1
SettingsFormTest class Drupal\Tests\media_library\Functional core/modules/media_library/tests/src/Functional/SettingsFormTest.php Tests the Media Library settings form.
SettingsFormTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/SettingsFormTest.php Tests Settings Form.
SettingsRewriteTest class Drupal\KernelTests\Core\Site core/tests/Drupal/KernelTests/Core/Site/SettingsRewriteTest.php Tests the SettingsEditor::rewrite() function.
SettingsTest class Drupal\Tests\Core\Site core/tests/Drupal/Tests/Core/Site/SettingsTest.php Tests Drupal\Core\Site\Settings.
SettingsTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/SettingsTest.php Tests all ui related settings under admin/structure/views/settings.
SettingsTest class Drupal\Tests\migrate_drupal_ui\FunctionalJavascript core/modules/migrate_drupal_ui/tests/src/FunctionalJavascript/SettingsTest.php Tests migrate upgrade credential form with settings in settings.php.
SettingsTrayBlockFormTest class Drupal\Tests\settings_tray\FunctionalJavascript core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php Testing opening and saving block forms in the off-canvas dialog.
SettingsTrayFormAnnotationIsClassBlock class Drupal\settings_tray_test\Plugin\Block core/modules/settings_tray/tests/modules/settings_tray_test/src/Plugin/Block/SettingsTrayFormAnnotationIsClassBlock.php Block that explicitly provides a "settings_tray" form class. 1
SettingsTrayFormAnnotationIsClassBlockForm class Drupal\settings_tray_test\Form core/modules/settings_tray/tests/modules/settings_tray_test/src/Form/SettingsTrayFormAnnotationIsClassBlockForm.php 1
SettingsTrayFormAnnotationIsFalseBlock class Drupal\settings_tray_test\Plugin\Block core/modules/settings_tray/tests/modules/settings_tray_test/src/Plugin/Block/SettingsTrayFormAnnotationIsFalseBlock.php Block that explicitly provides no "settings_tray" form, thus opting out.
SettingsTrayFormAnnotationNoneBlock class Drupal\settings_tray_test\Plugin\Block core/modules/settings_tray/tests/modules/settings_tray_test/src/Plugin/Block/SettingsTrayFormAnnotationNoneBlock.php Block that does nothing explicit for Settings Tray. 1
SettingsTrayHooks class Drupal\settings_tray\Hook core/modules/settings_tray/src/Hook/SettingsTrayHooks.php Hook implementations for settings_tray.
SettingsTrayTest class Drupal\Tests\settings_tray\Functional core/modules/settings_tray/tests/src/Functional/SettingsTrayTest.php Tests opening and saving block forms in the off-canvas dialog.
SettingsTrayTestBase abstract class Drupal\Tests\settings_tray\FunctionalJavascript core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php Base class for Settings Tray tests. 3
SettingsTrayTestCssHooks class Drupal\settings_tray_test_css\Hook core/modules/settings_tray/tests/modules/settings_tray_test_css/src/Hook/SettingsTrayTestCssHooks.php Hook implementations for settings_tray_test_css.
SettingsTrayThemeHooks class Drupal\settings_tray\Hook core/modules/settings_tray/src/Hook/SettingsTrayThemeHooks.php Hook implementations for settings_tray.
SettingSummariesContentTypeTest class Drupal\Tests\node\FunctionalJavascript core/modules/node/tests/src/FunctionalJavascript/SettingSummariesContentTypeTest.php Tests the JavaScript updating of summaries on content type form.
SettingsValidator final class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/SettingsValidator.php Checks that Drupal's settings are valid for Package Manager. 1
SettingsValidatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/SettingsValidatorTest.php Tests Settings Validator.
ShapeItem class Drupal\entity_test\Plugin\Field\FieldType core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ShapeItem.php Defines the 'shape' field type. 1
ShapeItemRequired class Drupal\entity_test\Plugin\Field\FieldType core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ShapeItemRequired.php Defines the 'shape_required' field type.
ShapeItemTest class Drupal\Tests\field\Kernel core/modules/field/tests/src/Kernel/ShapeItemTest.php Tests the new entity API for the shape field type.
ShapeOnlyColorEditableWidget class Drupal\entity_test\Plugin\Field\FieldWidget core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldWidget/ShapeOnlyColorEditableWidget.php Plugin implementation of the 'shape_only_color_editable_widget' widget.
SharedEntityTestBundleClassA class Drupal\entity_test_bundle_class\Entity core/modules/system/tests/modules/entity_test_bundle_class/src/Entity/SharedEntityTestBundleClassA.php A bundle class that shares the same entity type as entity_test. 2
SharedEntityTestBundleClassB class Drupal\entity_test_bundle_class\Entity core/modules/system/tests/modules/entity_test_bundle_class/src/Entity/SharedEntityTestBundleClassB.php A bundle class that shares the same entity type as entity_test. 2
SharedTempStore class Drupal\Core\TempStore core/lib/Drupal/Core/TempStore/SharedTempStore.php Stores and retrieves temporary data for a given owner. 3
SharedTempStoreFactory class Drupal\Core\TempStore core/lib/Drupal/Core/TempStore/SharedTempStoreFactory.php Creates a shared temporary storage for a collection. 9 2
SharedTempStoreTest class Drupal\Tests\Core\TempStore core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php Tests Drupal\Core\TempStore\SharedTempStore.
Shortcut class Drupal\shortcut\Entity core/modules/shortcut/src/Entity/Shortcut.php Defines the shortcut entity class. 12
Shortcut class Drupal\shortcut\Plugin\migrate\source\d7 core/modules/shortcut/src/Plugin/migrate/source/d7/Shortcut.php Drupal 7 shortcut links source from database. 1
ShortcutAccessControlHandler class Drupal\shortcut core/modules/shortcut/src/ShortcutAccessControlHandler.php Defines the access control handler for the shortcut entity type. 1
ShortcutCacheTagsTest class Drupal\Tests\shortcut\Kernel core/modules/shortcut/tests/src/Kernel/ShortcutCacheTagsTest.php Tests the Shortcut entity's cache tags.
ShortcutCacheTagsTest class Drupal\Tests\shortcut\Functional core/modules/shortcut/tests/src/Functional/ShortcutCacheTagsTest.php Tests the Shortcut entity's cache tags.
ShortcutClaroIntegrationTest class Drupal\Tests\shortcut\Kernel core/modules/shortcut/tests/src/Kernel/ShortcutClaroIntegrationTest.php Tests shortcut_install() and shortcut_uninstall().
ShortcutController class Drupal\shortcut\Controller core/modules/shortcut/src/Controller/ShortcutController.php Provides route responses for taxonomy.module.
ShortcutDeleteForm class Drupal\shortcut\Form core/modules/shortcut/src/Form/ShortcutDeleteForm.php Builds the shortcut link deletion form. 1
ShortcutEntityLinksTest class Drupal\Tests\shortcut\Kernel core/modules/shortcut/tests/src/Kernel/ShortcutEntityLinksTest.php Tests the entity_links filter with shortcut entities.
ShortcutForm class Drupal\shortcut core/modules/shortcut/src/ShortcutForm.php Form handler for the shortcut entity forms. 1
ShortcutHooks class Drupal\shortcut\Hook core/modules/shortcut/src/Hook/ShortcutHooks.php Hook implementations for shortcut.
ShortcutInterface interface Drupal\shortcut core/modules/shortcut/src/ShortcutInterface.php Provides an interface defining a shortcut entity. 1 4

Other projects


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