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
SortTest class Drupal\Tests\jsonapi\Unit\Query core/modules/jsonapi/tests/src/Unit/Query/SortTest.php Tests Drupal\jsonapi\Query\Sort.
SortTest class Drupal\Tests\CSpell core/tests/Drupal/Tests/CSpell/SortTest.php Tests that the dictionary.txt file is properly sorted.
SortTest class Drupal\Tests\PhpCs core/tests/Drupal/Tests/PhpCs/SortTest.php Tests that phpcs.xml.dist is properly sorted.
SortTestConfigEntityWithWeight class Drupal\Tests\Core\Config\Entity core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php Test entity class to test sorting.
SortTranslationTest class Drupal\Tests\views\Kernel\Handler core/modules/views/tests/src/Kernel/Handler/SortTranslationTest.php Tests sorting on translatable and not translatable fields.
SourceEditing class Drupal\ckeditor5\Plugin\CKEditor5Plugin core/modules/ckeditor5/src/Plugin/CKEditor5Plugin/SourceEditing.php CKEditor 5 Source Editing plugin configuration. 3 1
SourceEditingEmptyElementTest class Drupal\Tests\ckeditor5\FunctionalJavascript core/modules/ckeditor5/tests/src/FunctionalJavascript/SourceEditingEmptyElementTest.php Tests Drupal\ckeditor5\Plugin\CKEditor5Plugin\SourceEditing.
SourceEditingPluginTest class Drupal\Tests\ckeditor5\Unit core/modules/ckeditor5/tests/src/Unit/SourceEditingPluginTest.php Tests Drupal\ckeditor5\Plugin\CKEditor5Plugin\SourceEditing.
SourceEditingPreventSelfXssConstraint class Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingPreventSelfXssConstraint.php For disallowing Source Editing configuration that allows self-XSS.
SourceEditingPreventSelfXssConstraintValidator class Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingPreventSelfXssConstraintValidator.php Ensures Source Editing cannot be configured to allow self-XSS.
SourceEditingRedundantTagsConstraint class Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingRedundantTagsConstraint.php For disallowing Source Editing elements already supported by a plugin.
SourceEditingRedundantTagsConstraintValidator class Drupal\ckeditor5\Plugin\Validation\Constraint core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingRedundantTagsConstraintValidator.php Ensures tags already available via plugin are not be added to Source Editing.
SourceEditingTest class Drupal\Tests\ckeditor5\FunctionalJavascript core/modules/ckeditor5/tests/src/FunctionalJavascript/SourceEditingTest.php Tests Drupal\ckeditor5\Plugin\CKEditor5Plugin\SourceEditing.
SourceEditingTestBase abstract class Drupal\Tests\ckeditor5\FunctionalJavascript core/modules/ckeditor5/tests/src/FunctionalJavascript/SourceEditingTestBase.php Provides a base class for testing the source editing function. 2
SourceModuleTest class Drupal\Tests\migrate_drupal_ui\Kernel core/modules/migrate_drupal_ui/tests/src/Kernel/SourceModuleTest.php Tests source_module selection.
SourcePluginBase abstract class Drupal\migrate\Plugin\migrate\source core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php The base class for source plugins. 8 10
SourceProviderTest class Drupal\Tests\migrate_drupal_ui\Functional core/modules/migrate_drupal_ui/tests/src/Functional/SourceProviderTest.php Tests that a missing source provider error message is displayed.
SourceString class Drupal\locale core/modules/locale/src/SourceString.php Defines the locale source string object. 3
SpaceUsedTest class Drupal\Tests\file\Kernel core/modules/file/tests/src/Kernel/SpaceUsedTest.php Tests the spaceUsed() function.
SpecialAttributesRouteSubscriber class Drupal\Core\EventSubscriber core/lib/Drupal/Core/EventSubscriber/SpecialAttributesRouteSubscriber.php Provides a route subscriber which checks for invalid pattern variables. 1 2
SpecialAttributesRouteSubscriberTest class Drupal\Tests\Core\EventSubscriber core/tests/Drupal/Tests/Core/EventSubscriber/SpecialAttributesRouteSubscriberTest.php Tests Drupal\Core\EventSubscriber\SpecialAttributesRouteSubscriber.
Sql class Drupal\views\Plugin\views\query core/modules/views/src/Plugin/views/query/Sql.php Views query plugin for an SQL query. 4
Sql class Drupal\migrate\Plugin\migrate\id_map core/modules/migrate/src/Plugin/migrate/id_map/Sql.php Defines the sql based ID map implementation. 1 3
SqlBase abstract class Drupal\migrate\Plugin\migrate\source core/modules/migrate/src/Plugin/migrate/source/SqlBase.php Sources whose data may be fetched via a database connection. 11 12
SqlBase abstract class Drupal\views\Plugin\views\pager core/modules/views/src/Plugin/views/pager/SqlBase.php A common base class for sql based pager. 3 2
SqlBaseTest class Drupal\Tests\views\Unit\Plugin\pager core/modules/views/tests/src/Unit/Plugin/pager/SqlBaseTest.php Tests Drupal\views\Plugin\views\pager\SqlBase.
SqlBaseTest class Drupal\Tests\migrate\Unit core/modules/migrate/tests/src/Unit/SqlBaseTest.php Tests the SqlBase class.
SqlBaseTest class Drupal\Tests\migrate\Kernel core/modules/migrate/tests/src/Kernel/SqlBaseTest.php Tests the functionality of SqlBase.
SqlContentEntityStorage class Drupal\Core\Entity\Sql core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php A content entity database storage implementation. 11 21
SqlContentEntityStorageException class Drupal\Core\Entity\Sql core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageException.php Exception thrown when a SQL storage operation fails. 1
SqlContentEntityStorageSchema class Drupal\Core\Entity\Sql core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php Defines a schema handler that supports revisionable, translatable entities. 10 11
SqlContentEntityStorageSchemaColumnTest class Drupal\Tests\field\Kernel\Entity\Update core/modules/field/tests/src/Kernel/Entity/Update/SqlContentEntityStorageSchemaColumnTest.php Tests that schema changes in fields with data are detected during updates.
SqlContentEntityStorageSchemaTest class Drupal\Tests\Core\Entity\Sql core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php Tests Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema.
SqlContentEntityStorageSchemaTest class Drupal\KernelTests\Core\Entity\Sql core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageSchemaTest.php Tests Sql Content Entity Storage Schema.
SqlContentEntityStorageTest class Drupal\KernelTests\Core\Entity\Sql core/tests/Drupal/KernelTests/Core/Entity/Sql/SqlContentEntityStorageTest.php Tests that the deleteFromDedicatedTables() method only executes one DELETE query.
SqlContentEntityStorageTest class Drupal\Tests\Core\Entity\Sql core/tests/Drupal/Tests/Core/Entity/Sql/SqlContentEntityStorageTest.php Tests Drupal\Core\Entity\Sql\SqlContentEntityStorage.
SqlCountCache class Drupal\migrate_sql_count_cache_test\Plugin\migrate\source core/modules/migrate/tests/modules/migrate_sql_count_cache_test/src/Plugin/migrate/source/SqlCountCache.php Source plugin for Sql count cache test. 1
SqlEntityLoadingTest class Drupal\Tests\views\Kernel\Plugin core/modules/views/tests/src/Kernel/Plugin/SqlEntityLoadingTest.php Tests the loading of entities and entity revisions.
SqlEntityStorageInterface interface Drupal\Core\Entity\Sql core/lib/Drupal/Core/Entity/Sql/SqlEntityStorageInterface.php A common interface for SQL-based entity storage implementations. 1 7
SqlFieldableEntityTypeListenerTrait trait Drupal\Core\Entity\Sql core/lib/Drupal/Core/Entity/Sql/SqlFieldableEntityTypeListenerTrait.php Helper methods for EntityTypeListenerInterface.
SqlIdMapTest class Drupal\Tests\migrate\Kernel\Plugin\id_map core/modules/migrate/tests/src/Kernel/Plugin/id_map/SqlTest.php Defines a test SQL ID map for use in tests.
SqliteCastedIntFieldJoinTest class Drupal\Tests\sqlite\Kernel\sqlite\Plugin\views core/modules/sqlite/tests/src/Kernel/sqlite/Plugin/views/SqliteCastedIntFieldJoinTest.php Tests SQLite specific cast handling.
SqliteConnection class Drupal\sqlite\Driver\Database\sqlite core/modules/sqlite/src/Driver/Database/sqlite/SqliteConnection.php SQLite-specific implementation of a PDO connection. 2
SqliteDatabaseExcluder class Drupal\package_manager\PathExcluder core/modules/package_manager/src/PathExcluder/SqliteDatabaseExcluder.php Excludes SQLite database files from stage operations. 1
SqliteDatabaseExcluderTest class Drupal\Tests\package_manager\Kernel\PathExcluder core/modules/package_manager/tests/src/Kernel/PathExcluder/SqliteDatabaseExcluderTest.php Tests Sqlite Database Excluder.
SqliteDateSql class Drupal\views\Plugin\views\query core/modules/views/src/Plugin/views/query/SqliteDateSql.php SQLite-specific date handling. 1 2
SqliteDateSqlTest class Drupal\Tests\views\Unit\Plugin\views\query core/modules/views/tests/src/Unit/Plugin/views/query/SqliteDateSqlTest.php Tests the MySQL-specific date query handler.
SqliteHooks class Drupal\sqlite\Hook core/modules/sqlite/src/Hook/SqliteHooks.php Hook implementations for sqlite.
SqlModeTest class Drupal\Tests\mysql\Kernel\mysql core/modules/mysql/tests/src/Kernel/mysql/SqlModeTest.php Tests compatibility of the MySQL driver with various sql_mode options.
SqlModeTest class Drupal\Tests\mysqli\Kernel\mysqli core/modules/mysqli/tests/src/Kernel/mysqli/SqlModeTest.php Tests compatibility of the MySQL driver with various sql_mode options.

Other projects


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