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
SearchPluginManager class Drupal\search core/modules/search/src/SearchPluginManager.php SearchExecute plugin manager. 2
SearchPreprocessLangcodeTest class Drupal\Tests\search\Functional core/modules/search/tests/src/Functional/SearchPreprocessLangcodeTest.php Tests that the search preprocessing uses the correct language code.
SearchQuery class Drupal\search core/modules/search/src/SearchQuery.php Search query extender and helper functions. 2 4
SearchQuery class Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses core/tests/fixtures/database_drivers/module/core_fake/src/Driver/Database/CoreFakeWithAllCustomClasses/SearchQuery.php CoreFakeWithAllCustomClasses implementation of \Drupal\search\SearchQuery.
SearchQueryAlterTest class Drupal\Tests\search\Functional core/modules/search/tests/src/Functional/SearchQueryAlterTest.php Tests that the node search query can be altered via the query alter hook.
SearchRankingTest class Drupal\Tests\search\Functional core/modules/search/tests/src/Functional/SearchRankingTest.php Indexes content and tests ranking factors.
SearchRankingTest class Drupal\Tests\statistics\Functional\search core/modules/statistics/tests/src/Functional/search/SearchRankingTest.php Indexes content and tests ranking factors.
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.
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. 28
SectionComponent class Drupal\layout_builder core/modules/layout_builder/src/SectionComponent.php Provides a value object for a section component. 16
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 @coversDefaultClass \Drupal\layout_builder\SectionComponent[[api-linebreak]] @group layout_builder
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.
SectionListInterface interface Drupal\layout_builder core/modules/layout_builder/src/SectionListInterface.php Defines the interface for an object that stores layout sections. 4 3
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 @coversDefaultClass \Drupal\layout_builder\SectionListTrait[[api-linebreak]]
SectionRenderTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/SectionRenderTest.php @coversDefaultClass \Drupal\layout_builder\Section[[api-linebreak]] @group layout_builder
SectionStorage class Drupal\layout_builder\Annotation core/modules/layout_builder/src/Annotation/SectionStorage.php Defines a Section Storage type annotation object.
SectionStorage class Drupal\layout_builder\Attribute core/modules/layout_builder/src/Attribute/SectionStorage.php Defines a SectionStorage attribute. 6
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. 5 38
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 12
SectionStorageManagerTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/SectionStorageManagerTest.php @coversDefaultClass \Drupal\layout_builder\SectionStorage\SectionStorageManager[[api-linebreak]]
SectionTest class Drupal\Tests\layout_builder\Unit core/modules/layout_builder/tests/src/Unit/SectionTest.php @coversDefaultClass \Drupal\layout_builder\Section[[api-linebreak]] @group layout_builder
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 3
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
SecurityAdvisoriesFetcher final class Drupal\system\SecurityAdvisories core/modules/system/src/SecurityAdvisories/SecurityAdvisoriesFetcher.php Defines a service to get security advisories. 1 2
SecurityAdvisoriesFetcherTest class Drupal\Tests\system\Kernel\SecurityAdvisories core/modules/system/tests/src/Kernel/SecurityAdvisories/SecurityAdvisoriesFetcherTest.php @coversDefaultClass \Drupal\system\SecurityAdvisories\SecurityAdvisoriesFetcher[[api-linebreak]]
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 @coversDefaultClass \Drupal\system\SecurityAdvisories\SecurityAdvisory[[api-linebreak]]
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.
Select class Drupal\pgsql\Driver\Database\pgsql core/modules/pgsql/src/Driver/Database/pgsql/Select.php PostgreSQL implementation of \Drupal\Core\Database\Query\Select. 1 1
Select class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/Select.php SQLite implementation of \Drupal\Core\Database\Query\Select. 1 1
Select class Drupal\mysql\Driver\Database\mysql core/modules/mysql/src/Driver/Database/mysql/Select.php MySQL implementation of \Drupal\Core\Database\Query\Select.
Select class Drupal\Tests\Core\Database\Stub core/tests/Drupal/Tests/Core/Database/Stub/Select.php 1
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

in drupal:9.4.0 and is removed from drupal:11.0.0. The SQLite database driver has been moved to the sqlite module.

class Drupal\Core\Database\Driver\sqlite core/lib/Drupal/Core/Database/Driver/sqlite/Select.php SQLite implementation of \Drupal\Core\Database\Query\Select. 1

Other projects


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