Classes, traits, and interfaces - 9.5.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 1523

Name Deprecated Object type Namespace File name Summary Direct uses Use statements Strings
StubForm class Drupal\Tests\system\Functional\Form core/modules/system/tests/src/Functional/Form/StubForm.php Provides a stub form for testing purposes.
StubNegotiationMiddleware class Drupal\Tests\Core\StackMiddleware core/tests/Drupal/Tests/Core/StackMiddleware/NegotiationMiddlewareTest.php
StubPDO class Drupal\Tests\Core\Database\Stub core/tests/Drupal/Tests/Core/Database/Stub/StubPDO.php A stub of \PDO for testing purposes. 9
StubPluginManagerBaseWithMapper final class Drupal\Tests\Component\Plugin core/tests/Drupal/Tests/Component/Plugin/StubPluginManagerBaseWithMapper.php Stubs \Drupal\Component\Plugin\PluginManagerBase to take a MapperInterface.
StubReflectionFactory class Drupal\Tests\Component\Plugin\Factory core/tests/Drupal/Tests/Component/Plugin/Factory/ReflectionFactoryTest.php Override ReflectionFactory because ::createInstance() calls a static method.
StubRequestHandlerResourcePlugin class Drupal\Tests\rest\Kernel core/modules/rest/tests/src/Kernel/RequestHandlerTest.php Stub class where we can prophesize methods.
StubSourceGeneratorPlugin class Drupal\Tests\migrate\Unit core/modules/migrate/tests/src/Unit/MigrateSourceTest.php Defines a stubbed source plugin with a generator as iterator.
StubSourcePlugin class Drupal\Tests\migrate\Unit core/modules/migrate/tests/src/Unit/MigrateSourceTest.php Stubbed source plugin for testing base class implementations. 1
StubTestSuiteBase class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/TestSuiteBaseTest.php Stub subclass of TestSuiteBase.
StubThemeHandler class Drupal\Tests\Core\Extension core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php Extends the default theme handler to mock some drupal_ methods.
StubVariableTestClass class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/VariableTest.php No-op test class for VariableTest::testExport().
StyleFieldsTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/StyleFieldsTest.php Tests fields style functionality.
StyleGridTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/StyleGridTest.php Tests the grid style plugin.
StyleHtmlListTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/StyleHtmlListTest.php Tests the HTML list style plugin.
StyleMappingTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/StyleMappingTest.php Tests mapping style functionality.
StyleOpmlTest class Drupal\Tests\aggregator\Functional\Views\Plugin core/modules/aggregator/tests/src/Functional/Views/Plugin/StyleOpmlTest.php Tests the OPML feed style plugin.
StylePluginBase abstract class Drupal\views\Plugin\views\style core/modules/views/src/Plugin/views/style/StylePluginBase.php Base class for views style plugins. 12 4
StylesCombo class Drupal\ckeditor\Plugin\CKEditorPlugin core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php Defines the "stylescombo" plugin.
StyleSerializerKernelTest class Drupal\Tests\hal\Kernel\rest\Views core/modules/hal/tests/src/Kernel/rest/Views/StyleSerializerKernelTest.php @coversDefaultClass \Drupal\rest\Plugin\views\style\Serializer[[api-linebreak]] @group hal @group legacy
StyleSerializerKernelTest class Drupal\Tests\rest\Kernel\Views core/modules/rest/tests/src/Kernel/Views/StyleSerializerKernelTest.php @coversDefaultClass \Drupal\rest\Plugin\views\style\Serializer[[api-linebreak]] @group views
StyleSerializerTest class Drupal\Tests\rest\Functional\Views core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php Tests the serializer style plugin.
StyleSerializerTest class Drupal\Tests\hal\Functional\rest\Views core/modules/hal/tests/src/Functional/rest/Views/StyleSerializerTest.php Tests the serializer style plugin.
StyleSummaryTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/StyleSummaryTest.php Tests the summary style plugin.
StyleTableTest class Drupal\Tests\views\Functional\Plugin core/modules/views/tests/src/Functional/Plugin/StyleTableTest.php Tests the table style views plugin.
StyleTableTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/StyleTableTest.php Tests the UI of views when using the table style.
StyleTableUnitTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/StyleTableUnitTest.php Tests the table style plugin.
StyleTemplateTest class Drupal\views_test_data\Plugin\views\style core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTemplateTest.php Provides a general test style template plugin.
StyleTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/StyleTest.php Tests general style functionality.
StyleTest class Drupal\views_test_data\Plugin\views\style core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php Provides a general test style plugin. 1
StyleTestBase abstract class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/StyleTestBase.php Tests some general style plugin related functionality. 2
StyleUITest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/StyleUITest.php Tests the UI of style plugins.
StyleUnformattedTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/StyleUnformattedTest.php Tests unformatted style functionality.
SubformState class Drupal\Core\Form core/lib/Drupal/Core/Form/SubformState.php Stores information about the state of a subform. 15
SubformStateInterface interface Drupal\Core\Form core/lib/Drupal/Core/Form/SubformStateInterface.php Stores information about the state of a subform. 1 4
SubformStateTest class Drupal\Tests\Core\Form core/tests/Drupal/Tests/Core/Form/SubformStateTest.php @coversDefaultClass \Drupal\Core\Form\SubformState[[api-linebreak]]
Submit class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Submit.php Provides a form submit button. 1
SubProcess class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/SubProcess.php Runs an array of arrays through its own process pipeline. 1
SubProcessTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/SubProcessTest.php Tests the sub_process process plugin.
Subquery class Drupal\views\Plugin\views\join core/modules/views/src/Plugin/views/join/Subquery.php Join handler for relationships that join with a subquery as the left field.
Substr class Drupal\migrate\Plugin\migrate\process core/modules/migrate/src/Plugin/migrate/process/Substr.php Returns a substring of the input value. 1
SubstrTest class Drupal\Tests\migrate\Unit\process core/modules/migrate/tests/src/Unit/process/SubstrTest.php Tests the substr plugin.
SupernovaGenerator class Drupal\help_test core/modules/help/tests/modules/help_test/src/SupernovaGenerator.php Implements a URL generator which always thrown an exception. 1
SuspendQueueException class Drupal\Core\Queue core/lib/Drupal/Core/Queue/SuspendQueueException.php Exception class to throw to indicate that a cron queue should be skipped. 3
SvgIconBuilder class Drupal\Core\Layout\Icon core/lib/Drupal/Core/Layout/Icon/SvgIconBuilder.php Builds SVG layout icons. 1 2
SynchronizableEntityTrait trait Drupal\Core\Entity core/lib/Drupal/Core/Entity/SynchronizableEntityTrait.php Provides a trait for accessing synchronization information. 1
SynchronizableInterface interface Drupal\Core\Entity core/lib/Drupal/Core/Entity/SynchronizableInterface.php Defines methods for an entity that supports synchronization. 2 1
SysLog class Drupal\syslog\Logger core/modules/syslog/src/Logger/SysLog.php Redirects logging messages to syslog. 1 1 2
SyslogTest class Drupal\Tests\syslog\Kernel core/modules/syslog/tests/src/Kernel/SyslogTest.php Test syslog logger functionality.
SyslogTest class Drupal\Tests\syslog\Functional core/modules/syslog/tests/src/Functional/SyslogTest.php Tests syslog settings.
SysLogTest class Drupal\syslog_test\Logger core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php Redirects logging messages to error_log. 2

Other projects


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