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
WorkspaceAccessControlHandler class Drupal\workspaces core/modules/workspaces/src/WorkspaceAccessControlHandler.php Defines the access control handler for the workspace entity type.
WorkspaceAccessException class Drupal\workspaces core/modules/workspaces/src/WorkspaceAccessException.php Exception thrown when trying to switch to an inaccessible workspace. 1 3
WorkspaceAccessTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceAccessTest.php Tests access on workspaces.
WorkspaceActivateForm class Drupal\workspaces\Form core/modules/workspaces/src/Form/WorkspaceActivateForm.php Handle activation of a workspace on administrative pages.
WorkspaceAssociation class Drupal\workspaces core/modules/workspaces/src/WorkspaceAssociation.php Provides a class for CRUD operations on workspace associations. 2
WorkspaceAssociationDeprecationTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceAssociationDeprecationTest.php @coversDefaultClass \Drupal\workspaces\WorkspaceAssociation[[api-linebreak]] @group legacy
WorkspaceAssociationInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspaceAssociationInterface.php Defines an interface for the workspace_association service. 1 3
WorkspaceAssociationTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceAssociationTest.php Tests workspace associations.
WorkspaceBypassTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php Tests access bypass permission controls on workspaces.
WorkspaceCacheContext class Drupal\workspaces core/modules/workspaces/src/WorkspaceCacheContext.php Defines the WorkspaceCacheContext service, for "per workspace" caching. 1 2
WorkspaceCacheContextTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspaceCacheContextTest.php Tests the workspace cache context.
WorkspaceConcurrentEditingTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspaceConcurrentEditingTest.php Tests concurrent edits in different workspaces.
WorkspaceConflictException class Drupal\workspaces core/modules/workspaces/src/WorkspaceConflictException.php An exception thrown when two workspaces are in a conflicting content state.
WorkspaceContentModerationIntegrationTest class Drupal\Tests\content_moderation\Functional core/modules/content_moderation/tests/src/Functional/WorkspaceContentModerationIntegrationTest.php Tests Workspaces together with Content Moderation.
WorkspaceContentTranslationTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceContentTranslationTest.php Tests entity translations with workspaces.
WorkspaceCRUDTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceCRUDTest.php Tests CRUD operations for workspaces.
WorkspaceDeleteForm class Drupal\workspaces\Form core/modules/workspaces/src/Form/WorkspaceDeleteForm.php Provides a form for deleting a workspace.
WorkspaceDynamicSafeFormInterface interface Drupal\Core\Form core/lib/Drupal/Core/Form/WorkspaceDynamicSafeFormInterface.php Defines an interface for forms that can be workspace-safe. 10 12
WorkspaceEntityDeleteTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceEntityDeleteTest.php Tests entity deletions with workspaces.
WorkspaceEntityDeleteTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspaceEntityDeleteTest.php Tests entity deletions with workspaces.
WorkspaceForm class Drupal\workspaces\Form core/modules/workspaces/src/Form/WorkspaceForm.php Form controller for the workspace edit forms.
WorkspaceFormInterface

in drupal:10.3.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Form\WorkspaceSafeFormInterface or \Drupal\Core\Form\WorkspaceDynamicSafeFormInterface instead.

interface Drupal\workspaces\Form core/modules/workspaces/src/Form/WorkspaceFormInterface.php Defines interface for workspace forms so they can be easily distinguished.
WorkspaceHandlerInterface interface Drupal\workspaces\Entity\Handler core/modules/workspaces/src/Entity/Handler/WorkspaceHandlerInterface.php Defines workspace operations that need to vary by entity type. 2
WorkspaceIdNegotiatorInterface interface Drupal\workspaces\Negotiator core/modules/workspaces/src/Negotiator/WorkspaceIdNegotiatorInterface.php Interface for workspace negotiators that return only the negotiated ID. 2 1
WorkspaceInformation class Drupal\workspaces core/modules/workspaces/src/WorkspaceInformation.php General service for workspace support information. 2
WorkspaceInformationInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspaceInformationInterface.php Provides an interface for workspace-support information. 1 6
WorkspaceInformationTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceInformationTest.php Tests the workspace information service.
WorkspaceIntegrationTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceIntegrationTest.php Tests a complete publishing scenario across different workspaces.
WorkspaceInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspaceInterface.php Defines an interface for the workspace entity type. 1 9
WorkspaceJsonAnonTest class Drupal\Tests\workspaces\Functional\Rest core/modules/workspaces/tests/src/Functional/Rest/WorkspaceJsonAnonTest.php Test workspace entities for unauthenticated JSON requests.
WorkspaceJsonBasicAuthTest class Drupal\Tests\workspaces\Functional\Rest core/modules/workspaces/tests/src/Functional/Rest/WorkspaceJsonBasicAuthTest.php Test workspace entities for JSON requests via basic auth.
WorkspaceJsonCookieTest class Drupal\Tests\workspaces\Functional\Rest core/modules/workspaces/tests/src/Functional/Rest/WorkspaceJsonCookieTest.php Test workspace entities for JSON requests with cookie authentication.
WorkspaceListBuilder class Drupal\workspaces core/modules/workspaces/src/WorkspaceListBuilder.php Defines a class to build a listing of workspace entities.
WorkspaceManager class Drupal\workspaces core/modules/workspaces/src/WorkspaceManager.php Provides the workspace manager. 2
WorkspaceManagerInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspaceManagerInterface.php Provides an interface for managing Workspaces. 1 13
WorkspaceMenuLinkContentIntegrationTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspaceMenuLinkContentIntegrationTest.php Tests workspace integration for custom menu links.
WorkspaceMergeForm class Drupal\workspaces\Form core/modules/workspaces/src/Form/WorkspaceMergeForm.php Provides a form that merges the contents for a workspace into another one. 1
WorkspaceMerger class Drupal\workspaces core/modules/workspaces/src/WorkspaceMerger.php Default implementation of the workspace merger.
WorkspaceMergerInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspaceMergerInterface.php Defines an interface for the workspace merger. 1
WorkspaceMergerTest class Drupal\Tests\workspaces\Kernel core/modules/workspaces/tests/src/Kernel/WorkspaceMergerTest.php Tests workspace merging.
WorkspaceNegotiatorInterface interface Drupal\workspaces\Negotiator core/modules/workspaces/src/Negotiator/WorkspaceNegotiatorInterface.php Workspace negotiators provide a way to get the active workspace. 2 1
WorkspaceOperationFactory class Drupal\workspaces core/modules/workspaces/src/WorkspaceOperationFactory.php Defines a factory class for workspace operations. 3 2
WorkspaceOperationInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspaceOperationInterface.php Defines an interface for workspace operations. 2
WorkspacePermissionsTest class Drupal\Tests\workspaces\Functional core/modules/workspaces/tests/src/Functional/WorkspacePermissionsTest.php Tests permission controls on workspaces.
WorkspacePostPublishEvent class Drupal\workspaces\Event core/modules/workspaces/src/Event/WorkspacePostPublishEvent.php Defines the post-publish event class. 2
WorkspacePrePublishEvent class Drupal\workspaces\Event core/modules/workspaces/src/Event/WorkspacePrePublishEvent.php Defines the pre-publish event class. 2
WorkspacePublisher class Drupal\workspaces core/modules/workspaces/src/WorkspacePublisher.php Default implementation of the workspace publisher.
WorkspacePublisherInterface interface Drupal\workspaces core/modules/workspaces/src/WorkspacePublisherInterface.php Defines an interface for the workspace publisher. 1 1
WorkspacePublishEvent abstract class Drupal\workspaces\Event core/modules/workspaces/src/Event/WorkspacePublishEvent.php Defines the workspace publish event. 2 2
WorkspacePublishException class Drupal\workspaces core/modules/workspaces/src/WorkspacePublishException.php An exception thrown when a workspace can not be published. 2

Other projects


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