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
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.
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.
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
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 class Drupal\Tests\settings_tray\FunctionalJavascript core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php Base class for Settings Tray tests. 3
SettingSummariesContentTypeTest class Drupal\Tests\node\FunctionalJavascript core/modules/node/tests/src/FunctionalJavascript/SettingSummariesContentTypeTest.php Tests the JavaScript updating of summaries on content type form.
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. 2
SharedTempStoreFactory class Drupal\Core\TempStore core/lib/Drupal/Core/TempStore/SharedTempStoreFactory.php Creates a shared temporary storage for a collection. 7 2
SharedTempStoreTest class Drupal\Tests\Core\TempStore core/tests/Drupal/Tests/Core/TempStore/SharedTempStoreTest.php @coversDefaultClass \Drupal\Core\TempStore\SharedTempStore[[api-linebreak]] @group TempStore
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.
ShortcutAccessControlHandler class Drupal\shortcut core/modules/shortcut/src/ShortcutAccessControlHandler.php Defines the access control handler for the shortcut entity type.
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.
ShortcutForm class Drupal\shortcut core/modules/shortcut/src/ShortcutForm.php Form handler for the shortcut entity forms.
ShortcutInterface interface Drupal\shortcut core/modules/shortcut/src/ShortcutInterface.php Provides an interface defining a shortcut entity. 1 3
ShortcutJsonAnonTest class Drupal\Tests\shortcut\Functional\Rest core/modules/shortcut/tests/src/Functional/Rest/ShortcutJsonAnonTest.php @group rest
ShortcutJsonBasicAuthTest class Drupal\Tests\shortcut\Functional\Rest core/modules/shortcut/tests/src/Functional/Rest/ShortcutJsonBasicAuthTest.php @group rest
ShortcutJsonCookieTest class Drupal\Tests\shortcut\Functional\Rest core/modules/shortcut/tests/src/Functional/Rest/ShortcutJsonCookieTest.php @group rest
ShortcutLazyBuilder final class Drupal\navigation core/modules/navigation/src/ShortcutLazyBuilder.php Lazy Builders for Navigation shortcuts links.
ShortcutLazyBuilders class Drupal\shortcut core/modules/shortcut/src/ShortcutLazyBuilders.php Lazy builders for the shortcut module. 1 2
ShortcutLinksTest class Drupal\Tests\shortcut\Functional core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php Create, view, edit, delete, and change shortcut links.
ShortcutLocalTasksTest class Drupal\Tests\shortcut\Unit\Menu core/modules/shortcut/tests/src/Unit/Menu/ShortcutLocalTasksTest.php Tests existence of shortcut local tasks.
ShortcutResourceTestBase abstract class Drupal\Tests\shortcut\Functional\Rest core/modules/shortcut/tests/src/Functional/Rest/ShortcutResourceTestBase.php ResourceTestBase for Shortcut entity. 6
ShortcutsBlock class Drupal\shortcut\Plugin\Block core/modules/shortcut/src/Plugin/Block/ShortcutsBlock.php Provides a 'Shortcut' block.
ShortcutSet class Drupal\shortcut\Entity core/modules/shortcut/src/Entity/ShortcutSet.php Defines the Shortcut set configuration entity. 13
ShortcutSet class Drupal\shortcut\Plugin\migrate\source\d7 core/modules/shortcut/src/Plugin/migrate/source/d7/ShortcutSet.php Drupal 7 shortcut_set source from database.
ShortcutSetAccessControlHandler class Drupal\shortcut core/modules/shortcut/src/ShortcutSetAccessControlHandler.php Defines the access control handler for the shortcut set entity type.
ShortcutSetController class Drupal\shortcut\Controller core/modules/shortcut/src/Controller/ShortcutSetController.php Builds the page for administering shortcut sets.
ShortcutSetDeleteForm class Drupal\shortcut\Form core/modules/shortcut/src/Form/ShortcutSetDeleteForm.php Builds the shortcut set deletion form.
ShortcutSetForm class Drupal\shortcut core/modules/shortcut/src/ShortcutSetForm.php Form handler for the shortcut set entity edit forms.
ShortcutSetInterface interface Drupal\shortcut core/modules/shortcut/src/ShortcutSetInterface.php Provides an interface defining a shortcut set entity. 1 6
ShortcutSetJsonAnonTest class Drupal\Tests\shortcut\Functional\Rest core/modules/shortcut/tests/src/Functional/Rest/ShortcutSetJsonAnonTest.php @group rest
ShortcutSetJsonBasicAuthTest class Drupal\Tests\shortcut\Functional\Rest core/modules/shortcut/tests/src/Functional/Rest/ShortcutSetJsonBasicAuthTest.php @group rest
ShortcutSetJsonCookieTest class Drupal\Tests\shortcut\Functional\Rest core/modules/shortcut/tests/src/Functional/Rest/ShortcutSetJsonCookieTest.php @group rest
ShortcutSetListBuilder class Drupal\shortcut core/modules/shortcut/src/ShortcutSetListBuilder.php Defines a class to build a listing of shortcut set entities.
ShortcutSetResourceTestBase abstract class Drupal\Tests\shortcut\Functional\Rest core/modules/shortcut/tests/src/Functional/Rest/ShortcutSetResourceTestBase.php ResourceTestBase for ShortcutSet entity. 6
ShortcutSetsTest class Drupal\Tests\shortcut\Functional core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php Create, view, edit, delete, and change shortcut sets.

Other projects


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