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
SearchRequirements class Drupal\search\Hook core/modules/search/src/Hook/SearchRequirements.php Requirements for the Search module.
SearchRow class Drupal\search\Plugin\views\row core/modules/search/src/Plugin/views/row/SearchRow.php Row handler plugin for displaying search results.
SearchSetLocaleTest class Drupal\Tests\search\Kernel core/modules/search/tests/src/Kernel/SearchSetLocaleTest.php Tests that search works with numeric locale settings.
SearchTextProcessor class Drupal\search core/modules/search/src/SearchTextProcessor.php Processes search text for indexing. 2
SearchTextProcessorInterface interface Drupal\search core/modules/search/src/SearchTextProcessorInterface.php Processes search text for indexing. 1 3
SearchTextProcessorTest class Drupal\Tests\search\Kernel core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php Test search text preprocessing functionality.
SearchThemeHooks class Drupal\search\Hook core/modules/search/src/Hook/SearchThemeHooks.php Theme hook implementations for search.
SearchTokenizerTest class Drupal\Tests\search\Kernel core/modules/search/tests/src/Kernel/SearchTokenizerTest.php Tests that CJK tokenizer works as intended.
Section class Drupal\layout_builder core/modules/layout_builder/src/Section.php Provides a domain object for layout sections. 30
SectionComponent class Drupal\layout_builder core/modules/layout_builder/src/SectionComponent.php Provides a value object for a section component. 19
SectionComponentBuildRenderArrayEvent class Drupal\layout_builder\Event core/modules/layout_builder/src/Event/SectionComponentBuildRenderArrayEvent.php Event fired when a section component's render array is being built. 4
SectionComponentTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php Tests Drupal\layout_builder\SectionComponent.
SectionData class Drupal\layout_builder\Plugin\DataType core/modules/layout_builder/src/Plugin/DataType/SectionData.php Provides a data type wrapping \Drupal\layout_builder\Section. 1
SectionDataTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/SectionDataTest.php Tests Drupal\layout_builder\Plugin\DataType\SectionData.
SectionListInterface interface Drupal\layout_builder core/modules/layout_builder/src/SectionListInterface.php Defines the interface for an object that stores layout sections. 4 6
SectionListTestBase abstract class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php Provides a base class for testing implementations of a section list. 4
SectionListTrait trait Drupal\layout_builder core/modules/layout_builder/src/SectionListTrait.php Provides a trait for maintaining a list of sections. 5
SectionListTraitTest class Drupal\Tests\layout_builder\Kernel core/modules/layout_builder/tests/src/Kernel/SectionListTraitTest.php Tests Drupal\layout_builder\SectionListTrait.
SectionRenderTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php Tests Drupal\layout_builder\Section.
SectionStorage class Drupal\layout_builder\Attribute core/modules/layout_builder/src/Attribute/SectionStorage.php Defines a SectionStorage attribute. 6
SectionStorage class Drupal\layout_builder\Annotation core/modules/layout_builder/src/Annotation/SectionStorage.php Defines a Section Storage type annotation object.
SectionStorageBase abstract class Drupal\layout_builder\Plugin\SectionStorage core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageBase.php Provides a base class for Section Storage types. 3 1
SectionStorageDefinition class Drupal\layout_builder\SectionStorage core/modules/layout_builder/src/SectionStorage/SectionStorageDefinition.php Provides section storage type plugin definition. 9
SectionStorageInterface interface Drupal\layout_builder core/modules/layout_builder/src/SectionStorageInterface.php Defines an interface for Section Storage type plugins. 4 40
SectionStorageLocalTaskProviderInterface interface Drupal\layout_builder\Plugin\SectionStorage core/modules/layout_builder/src/Plugin/SectionStorage/SectionStorageLocalTaskProviderInterface.php Allows section storage plugins to provide local tasks. 3 3
SectionStorageManager class Drupal\layout_builder\SectionStorage core/modules/layout_builder/src/SectionStorage/SectionStorageManager.php Provides the Section Storage type plugin manager. 1 2
SectionStorageManagerInterface interface Drupal\layout_builder\SectionStorage core/modules/layout_builder/src/SectionStorage/SectionStorageManagerInterface.php Provides the interface for a plugin manager of section storage types. 1 16
SectionStorageManagerTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php Tests Drupal\layout_builder\SectionStorage\SectionStorageManager.
SectionTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/SectionTest.php Tests Drupal\layout_builder\Section.
Secure class Drupal\Tests\Component\Annotation\Doctrine\Fixtures\Annotation core/tests/Drupal/Tests/Component/Annotation/Doctrine/Fixtures/Annotation/Secure.php
SecuredRedirectResponse abstract class Drupal\Component\HttpFoundation core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php Provides a common base class for safe redirects. 2 4
SecuredRedirectResponseTest class Drupal\Tests\Component\HttpFoundation core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php Test secure redirect base class.
SecuredRedirectStub class Drupal\Tests\Component\HttpFoundation core/tests/Drupal/Tests/Component/HttpFoundation/SecuredRedirectResponseTest.php Test class for safe redirects.
SecurityAdvisoriesFetcher final class Drupal\system\SecurityAdvisories core/modules/system/src/SecurityAdvisories/SecurityAdvisoriesFetcher.php Defines a service to get security advisories. 2 2
SecurityAdvisoriesFetcherTest class Drupal\Tests\system\Kernel\SecurityAdvisories core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php Tests Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher.
SecurityAdvisory final class Drupal\system\SecurityAdvisories core/modules/system/src/SecurityAdvisories/SecurityAdvisory.php Provides a security advisory value object. 1
SecurityAdvisoryTest class Drupal\Tests\system\Unit\SecurityAdvisories core/modules/system/tests/src/Unit/SecurityAdvisories/SecurityAdvisoryTest.php Tests Drupal\system\SecurityAdvisories\SecurityAdvisory.
SecurityAdvisoryTest class Drupal\Tests\system\Functional\SecurityAdvisories core/modules/system/tests/src/Functional/SecurityAdvisories/SecurityAdvisoryTest.php Tests of security advisories functionality.
SecurityFileUploadEventSubscriber class Drupal\system\EventSubscriber core/modules/system/src/EventSubscriber/SecurityFileUploadEventSubscriber.php The final subscriber to 'file.upload.sanitize.name'. 1 2
SecurityFileUploadEventSubscriberTest class Drupal\Tests\system\Unit\Event core/modules/system/tests/src/Unit/Event/SecurityFileUploadEventSubscriberTest.php SecurityFileUploadEventSubscriber tests.
SeeTest abstract class Drupal\Tests\Core\Foo core/tests/PHPStan/fixtures/test-classes-with-metadata.php With some docs.
Select class Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/Select.php CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Select.
Select class Drupal\Core\Render\Element core/lib/Drupal/Core/Render/Element/Select.php Provides a form element for a drop-down menu or scrolling selection box. 1
Select class Drupal\Tests\Core\Database\Stub core/tests/Drupal/Tests/Core/Database/Stub/Select.php A stub of the MySQL query builder for SELECT statements.
Select class Drupal\pgsql\Driver\Database\pgsql core/modules/pgsql/src/Driver/Database/pgsql/Select.php PostgreSQL implementation of \Drupal\Core\Database\Query\Select.
Select class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/Select.php SQLite implementation of \Drupal\Core\Database\Query\Select.
Select class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/Select.php Query builder for SELECT statements. 4 11
SelectCloneTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/SelectCloneTest.php Tests cloning Select queries.
SelectComplexTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php Tests the Select query builder with more complex queries.
SelectExtender class Drupal\Core\Database\Query core/lib/Drupal/Core/Database/Query/SelectExtender.php The base extender class for Select queries. 3 6

Other projects


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