Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / workspaces / src / WorkspaceManagerInterface.php
1 <?php
2
3 namespace Drupal\workspaces;
4
5 use Drupal\Core\Entity\EntityTypeInterface;
6
7 /**
8  * Provides an interface for managing Workspaces.
9  */
10 interface WorkspaceManagerInterface {
11
12   /**
13    * Returns whether an entity type can belong to a workspace or not.
14    *
15    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
16    *   The entity type to check.
17    *
18    * @return bool
19    *   TRUE if the entity type can belong to a workspace, FALSE otherwise.
20    */
21   public function isEntityTypeSupported(EntityTypeInterface $entity_type);
22
23   /**
24    * Returns an array of entity types that can belong to workspaces.
25    *
26    * @return \Drupal\Core\Entity\EntityTypeInterface[]
27    *   The entity types what can belong to workspaces.
28    */
29   public function getSupportedEntityTypes();
30
31   /**
32    * Gets the active workspace.
33    *
34    * @return \Drupal\workspaces\WorkspaceInterface
35    *   The active workspace entity object.
36    */
37   public function getActiveWorkspace();
38
39   /**
40    * Sets the active workspace via the workspace negotiators.
41    *
42    * @param \Drupal\workspaces\WorkspaceInterface $workspace
43    *   The workspace to set as active.
44    *
45    * @return $this
46    *
47    * @throws \Drupal\workspaces\WorkspaceAccessException
48    *   Thrown when the current user doesn't have access to view the workspace.
49    */
50   public function setActiveWorkspace(WorkspaceInterface $workspace);
51
52   /**
53    * Determines whether runtime entity operations should be altered.
54    *
55    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
56    *   The entity type to check.
57    *
58    * @return bool
59    *   TRUE if the entity operations or queries should be altered in the current
60    *   request, FALSE otherwise.
61    */
62   public function shouldAlterOperations(EntityTypeInterface $entity_type);
63
64 }