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
SerializationTest class Drupal\Tests\serialization\Kernel core/modules/serialization/tests/src/Kernel/SerializationTest.php Functional tests for serialization system.
SerializationTestEncoder class Drupal\serialization_test core/modules/serialization/tests/serialization_test/src/SerializationTestEncoder.php Serialization encoder used for testing. 2
SerializationTestNormalizer class Drupal\serialization_test core/modules/serialization/tests/serialization_test/src/SerializationTestNormalizer.php Serialization normalizer used for testing. 2
Serialized class Drupal\views\Plugin\views\field core/modules/views/src/Plugin/views/field/Serialized.php Field handler to show data of serialized fields.
SerializedColumnNormalizerTrait trait Drupal\serialization\Normalizer core/modules/serialization/src/Normalizer/SerializedColumnNormalizerTrait.php A trait providing methods for serialized columns. 1
SerializedConstraint class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/SerializedConstraint.php Checks for valid serialized data. 1
SerializedConstraintValidator class Drupal\Core\Validation\Plugin\Validation\Constraint core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/SerializedConstraintValidator.php Validates the Serialized constraint. 1
SerializedConstraintValidatorTest class Drupal\Tests\Core\Validation\Plugin\Validation\Constraint core/tests/Drupal/Tests/Core/Validation/Plugin/Validation/Constraint/SerializedConstraintValidatorTest.php Tests serialize validator.
SerializedItem class Drupal\entity_test\Plugin\Field\FieldType core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/SerializedItem.php Defines the 'serialized_item' entity field type. 1
SerializedPropertyItem class Drupal\entity_test\Plugin\Field\FieldType core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/SerializedPropertyItem.php Defines the 'serialized_property_item_test' entity field type.
SerializeQueryTest class Drupal\KernelTests\Core\Database core/tests/Drupal/KernelTests/Core/Database/SerializeQueryTest.php Tests serializing and unserializing a query.
Serializer class Drupal\serialization\Serializer core/modules/serialization/src/Serializer/Serializer.php Serializer with JSON Schema generation convenience methods. 2
Serializer class Drupal\rest\Plugin\views\style core/modules/rest/src/Plugin/views/style/Serializer.php The style plugin for serialized output formats. 2
Serializer final class Drupal\jsonapi\Serializer core/modules/jsonapi/src/Serializer/Serializer.php Overrides the Symfony serializer to cordon off our incompatible normalizers. 2 2
SerializeResponseTest class Drupal\Tests\big_pipe\Kernel core/modules/big_pipe/tests/src/Kernel/SerializeResponseTest.php Tests that big_pipe responses can be serialized.
SerializerTest class Drupal\Tests\jsonapi\Kernel\Serializer core/modules/jsonapi/tests/src/Kernel/Serializer/SerializerTest.php Tests the JSON:API serializer.
SerializerTest class Drupal\Tests\rest\Unit\Plugin\views\style core/modules/rest/tests/src/Unit/Plugin/views/style/SerializerTest.php Tests Drupal\rest\Plugin\views\style\Serializer.
ServerCommand class Drupal\Core\Command core/lib/Drupal/Core/Command/ServerCommand.php Runs the PHP webserver for a Drupal site for local testing/development.
ServerEndpointController final class Drupal\sdc_test\Controller core/modules/system/tests/modules/sdc_test/src/Controller/ServerEndpointController.php An endpoint to serve a component during tests.
Service class Drupal\new_dependency_test core/modules/system/tests/modules/new_dependency_test/src/Service.php A service that can decorated itself. 5
ServiceClassDefault class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php A class used for testing the backend compiler passes. 3
ServiceClassDriverTestMysql class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php A class used for testing the backend compiler passes.
ServiceClassMariaDb class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php A class used for testing the backend compiler passes.
ServiceClassMysql class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php A class used for testing the backend compiler passes. 1
ServiceClassSqlite class Drupal\Tests\Core\DependencyInjection\Compiler core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php A class used for testing the backend compiler passes.
ServiceDeprecationTest class Drupal\FunctionalTests\Core\Container core/tests/Drupal/FunctionalTests/Core/Container/ServiceDeprecationTest.php Test whether deprecation notices are triggered via \Drupal::service().
ServiceDestructionTest class Drupal\KernelTests\Core\DrupalKernel core/tests/Drupal/KernelTests/Core/DrupalKernel/ServiceDestructionTest.php Tests that services are correctly destructed.
ServiceModifierInterface interface Drupal\Core\DependencyInjection core/lib/Drupal/Core/DependencyInjection/ServiceModifierInterface.php Interface that service providers can implement to modify services. 14 15
ServiceProviderBase abstract class Drupal\Core\DependencyInjection core/lib/Drupal/Core/DependencyInjection/ServiceProviderBase.php Base service provider implementation. 9 9
ServiceProviderInterface interface Drupal\Core\DependencyInjection core/lib/Drupal/Core/DependencyInjection/ServiceProviderInterface.php Interface that all service providers must implement. 15 15
ServiceProviderTest class Drupal\KernelTests\Core\ServiceProvider core/tests/Drupal/KernelTests/Core/ServiceProvider/ServiceProviderTest.php Tests service provider registration to the DIC.
ServiceProviderTestServiceProvider class Drupal\service_provider_test core/modules/system/tests/modules/service_provider_test/src/ServiceProviderTestServiceProvider.php Service provider for service provider testing module.
ServiceProviderWebTest class Drupal\Tests\system\Functional\ServiceProvider core/modules/system/tests/src/Functional/ServiceProvider/ServiceProviderWebTest.php Tests service provider registration to the DIC.
ServiceProviderWebTest class Drupal\Tests\system\Kernel\ServiceProvider core/modules/system/tests/src/Kernel/ServiceProvider/ServiceProviderWebTest.php Tests service provider registration to the DIC.
ServicesDefaultsTest class Drupal\KernelTests\Core\DependencyInjection core/tests/Drupal/KernelTests/Core/DependencyInjection/ServicesDefaultsTest.php Tests services _defaults definition.
ServicesTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/ServicesTest.php Tests that Package Manager services are wired correctly.
ServiceWithDependency class Drupal\new_dependency_test core/modules/system/tests/modules/new_dependency_test/src/ServiceWithDependency.php Service that gets the other service of the same module injected. 6
Session class Drupal\Core\StackMiddleware core/lib/Drupal/Core/StackMiddleware/Session.php Wrap session logic around a HTTP request. 2
SessionAuthenticationTest class Drupal\Tests\system\Functional\Session core/modules/system/tests/src/Functional/Session/SessionAuthenticationTest.php Tests if sessions are correctly handled when a user authenticates.
SessionCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/SessionCacheContext.php Defines the SessionCacheContext service, for "per session" caching. 1 2
SessionCacheContextTest class Drupal\Tests\Core\Cache\Context core/tests/Drupal/Tests/Core/Cache/Context/SessionCacheContextTest.php Tests Drupal\Core\Cache\Context\SessionCacheContext.
SessionConfiguration class Drupal\Core\Session core/lib/Drupal/Core/Session/SessionConfiguration.php Defines the default session configuration generator. 2 2
SessionConfigurationInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/SessionConfigurationInterface.php Defines an interface for session configuration generators. 1 11
SessionConfigurationTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/SessionConfigurationTest.php Tests Drupal\Core\Session\SessionConfiguration.
SessionExistsCacheContext class Drupal\Core\Cache\Context core/lib/Drupal/Core/Cache/Context/SessionExistsCacheContext.php Defines the SessionExistsCacheContext service, for "session or not" caching. 2
SessionExistsCacheContextTest class Drupal\Tests\system\Functional\Cache core/modules/system/tests/src/Functional/Cache/SessionExistsCacheContextTest.php Tests the 'session.exists' cache context service.
SessionExistsCacheContextTestHooks class Drupal\session_exists_cache_context_test\Hook core/modules/system/tests/modules/session_exists_cache_context_test/src/Hook/SessionExistsCacheContextTestHooks.php Hook implementations for session_exists_cache_context_test.
SessionHandler class Drupal\Core\Session core/lib/Drupal/Core/Session/SessionHandler.php Default session handler. 2
SessionHttpsTest class Drupal\Tests\system\Functional\Session core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php Ensure that when running under HTTPS two session cookies are generated.
SessionManager class Drupal\Core\Session core/lib/Drupal/Core/Session/SessionManager.php Manages user sessions. 1 2

Other projects


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