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
WorkspaceSwitchEvent class Drupal\workspaces\Event core/modules/workspaces/src/Event/WorkspaceSwitchEvent.php Defines the workspace switch event. 3
WorkspaceSwitchSubscriber class Drupal\workspaces\EventSubscriber core/modules/workspaces/src/EventSubscriber/WorkspaceSwitchSubscriber.php Provides a event subscriber for reacting to workspace activation.
WorkspaceTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspaceTest.php Test the workspace entity.
WorkspaceTest class Drupal\Tests\jsonapi\Functional core/modules/jsonapi/tests/src/Functional/WorkspaceTest.php JSON:API integration test for the "Workspace" content entity type.
WorkspaceTestTrait trait Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceTestTrait.php A trait with common workspaces testing functionality. 1
WorkspaceTestUtilities trait Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php Utility methods for use in BrowserTestBase tests. 2
WorkspaceToolbarIntegrationTest class Drupal\Tests\workspaces_ui\FunctionalJavascript core/modules/workspaces_ui/tests/src/FunctionalJavascript/WorkspaceToolbarIntegrationTest.php Tests workspace settings stray integration.
WorkspaceTracker class Drupal\workspaces core/modules/workspaces/src/WorkspaceTracker.php Provides a class for CRUD operations on workspace associations. 4 2
WorkspaceTrackerInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspaceTrackerInterface.php Defines an interface for the workspace tracker service. 1 6
WorkspaceTrackerTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceTrackerTest.php Tests workspace tracker.
WorkspaceViewBuilder class Drupal\workspaces_ui core/modules/workspaces_ui/src/WorkspaceViewBuilder.php Provides a Workspace view builder. 1
WorkspaceViewsBulkFormTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspaceViewsBulkFormTest.php Tests the views bulk form in a workspace.
WorkspaceViewsIntegrationTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceViewsIntegrationTest.php Tests the views integration for workspaces.
WorkspaceViewTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspaceViewTest.php Tests permission controls on workspaces.
WorkspaceXmlAnonTest class Drupal\Tests\workspaces\Functional\Rest core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlAnonTest.php Test workspace entities for unauthenticated XML requests.
WorkspaceXmlBasicAuthTest class Drupal\Tests\workspaces\Functional\Rest core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlBasicAuthTest.php Test workspace entities for XML requests with cookie authentication.
WorkspaceXmlCookieTest class Drupal\Tests\workspaces\Functional\Rest core/modules/workspaces/tests/src/Functional/Rest/WorkspaceXmlCookieTest.php Test workspace entities for XML requests.
WritableFileSystemValidator class Drupal\package_manager\Validator core/modules/package_manager/src/Validator/WritableFileSystemValidator.php Checks that the file system is writable. 2
WritableFileSystemValidatorTest class Drupal\Tests\package_manager\Kernel core/modules/package_manager/tests/src/Kernel/WritableFileSystemValidatorTest.php Unit tests the file system permissions validator.
WriteSafeSessionHandler class Drupal\Core\Session core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php Wraps the session handler to prevent writes when not necessary or allowed. 1 2
WriteSafeSessionHandlerInterface interface Drupal\Core\Session core/lib/Drupal/Core/Session/WriteSafeSessionHandlerInterface.php Provides an interface for session handlers where writing can be disabled. 1
WriteSafeSessionHandlerTest class Drupal\Tests\Core\Session core/tests/Drupal/Tests/Core/Session/WriteSafeSessionHandlerTest.php Tests \Drupal\Core\Session\WriteSafeSessionHandler.
XdebugRequestTrait trait Drupal\Tests core/tests/Drupal/Tests/XdebugRequestTrait.php Trait for testing with Xdebug cookies extraction from request. 1
XdebugRequestTraitTest class Drupal\Tests\Core\Test core/tests/Drupal/Tests/Core/Test/XdebugRequestTraitTest.php Provides tests for the Xdebug request trait.
XmlEncoder class Drupal\serialization\Encoder core/modules/serialization/src/Encoder/XmlEncoder.php Adds XML support for serializer. 2 2
XmlEncoderTest class Drupal\Tests\serialization\Unit\Encoder core/modules/serialization/tests/src/Unit/Encoder/XmlEncoderTest.php Tests Drupal\serialization\Encoder\XmlEncoder.
XmlEntityNormalizationQuirksTrait trait Drupal\Tests\rest\Functional\EntityResource core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php Trait for EntityResourceTestBase subclasses testing $format='xml'. 141
XmlNormalizationQuirksTrait trait Drupal\Tests\rest\Functional core/modules/rest/tests/src/Functional/XmlNormalizationQuirksTrait.php Trait for ResourceTestBase subclasses testing $format='xml'. 1
Xss class Drupal\Component\Utility core/lib/Drupal/Component/Utility/Xss.php Provides helper to filter for cross-site scripting. 1 52
XssTest class Drupal\Tests\views_ui\Functional core/modules/views_ui/tests/src/Functional/XssTest.php Tests the Xss vulnerability.
XssTest class Drupal\Tests\Component\Utility core/tests/Drupal/Tests/Component/Utility/XssTest.php XSS Filtering tests.
XssUnitTest class Drupal\KernelTests\Core\Common core/tests/Drupal/KernelTests/Core/Common/XssUnitTest.php Tests XSS filtering.
XyzMissingTargetAlter class Drupal\xyz_hook_order_test\Hook core/modules/system/tests/modules/HookOrder/xyz_hook_order_test/src/Hook/XyzMissingTargetAlter.php This class contains attributes to reorder or remove alter implementations.
XyzMissingTargetHooks class Drupal\xyz_hook_order_test\Hook core/modules/system/tests/modules/HookOrder/xyz_hook_order_test/src/Hook/XyzMissingTargetHooks.php This class contains attributes to reorder or remove hook implementations.
Yaml class Drupal\Component\Serialization core/lib/Drupal/Component/Serialization/Yaml.php Provides a YAML serialization implementation using symfony/yaml. 32 2
YamlCacheCollector class Drupal\Core\Utility core/lib/Drupal/Core/Utility/YamlCacheCollector.php Caches YAML parsing in a cache collector. 4 3
YamlCacheCollectorDiscovery class Drupal\Core\Discovery core/lib/Drupal/Core/Discovery/YamlCacheCollectorDiscovery.php Provides discovery for YAML files within a given set of directories. 1
YamlCacheCollectorTest class Drupal\Tests\Core\Utility core/tests/Drupal/Tests/Core/Utility/YamlCacheCollectorTest.php Tests Drupal\Core\Cache\CacheCollector.
YamlDirectoryDiscovery class Drupal\Core\Plugin\Discovery core/lib/Drupal/Core/Plugin/Discovery/YamlDirectoryDiscovery.php Allows multiple YAML files per directory to define plugin definitions. 2
YamlDirectoryDiscovery class Drupal\Component\Discovery core/lib/Drupal/Component/Discovery/YamlDirectoryDiscovery.php Discovers multiple YAML files in a set of directories. 1 6
YamlDirectoryDiscoveryTest class Drupal\Tests\Core\Plugin\Discovery core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php Tests Drupal\Core\Plugin\Discovery\YamlDirectoryDiscovery.
YamlDirectoryDiscoveryTest class Drupal\Tests\Component\Discovery core/tests/Drupal/Tests/Component/Discovery/YamlDirectoryDiscoveryTest.php YamlDirectoryDiscoveryTest component unit tests.
YamlDiscovery class Drupal\Core\Discovery core/lib/Drupal/Core/Discovery/YamlDiscovery.php Provides discovery for YAML files within a given set of directories. 1 6
YamlDiscovery class Drupal\Core\Plugin\Discovery core/lib/Drupal/Core/Plugin/Discovery/YamlDiscovery.php Allows YAML files to define plugin definitions. 3 11
YamlDiscovery class Drupal\Component\Discovery core/lib/Drupal/Component/Discovery/YamlDiscovery.php Provides discovery for YAML files within a given set of directories. 1 4
YamlDiscoveryDecorator class Drupal\Core\Plugin\Discovery core/lib/Drupal/Core/Plugin/Discovery/YamlDiscoveryDecorator.php Enables YAML discovery for plugin definitions. 4
YamlDiscoveryDecoratorTest class Drupal\Tests\Core\Plugin\Discovery core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php YamlDiscoveryDecorator unit tests.
YamlDiscoveryTest class Drupal\Tests\Core\Plugin\Discovery core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php Tests Drupal\Core\Plugin\Discovery\YamlDiscovery.
YamlDiscoveryTest class Drupal\Tests\Component\Discovery core/tests/Drupal/Tests/Component/Discovery/YamlDiscoveryTest.php YamlDiscovery component unit tests.
YamlDiscoveryTest class Drupal\Tests\Core\Discovery core/tests/Drupal/Tests/Core/Discovery/YamlDiscoveryTest.php YamlDiscovery component unit tests.

Other projects


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