WorkspaceInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Drupal\workspaces;
  3. use Drupal\Core\Entity\ContentEntityInterface;
  4. use Drupal\Core\Entity\EntityChangedInterface;
  5. use Drupal\user\EntityOwnerInterface;
  6. /**
  7. * Defines an interface for the workspace entity type.
  8. */
  9. interface WorkspaceInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface {
  10. /**
  11. * The ID of the default workspace.
  12. */
  13. const DEFAULT_WORKSPACE = 'live';
  14. /**
  15. * Publishes the contents of this workspace to the default (Live) workspace.
  16. */
  17. public function publish();
  18. /**
  19. * Determines whether the workspace is the default one or not.
  20. *
  21. * @return bool
  22. * TRUE if this workspace is the default one (e.g 'Live'), FALSE otherwise.
  23. */
  24. public function isDefaultWorkspace();
  25. /**
  26. * Gets the workspace creation timestamp.
  27. *
  28. * @return int
  29. * Creation timestamp of the workspace.
  30. */
  31. public function getCreatedTime();
  32. /**
  33. * Sets the workspace creation timestamp.
  34. *
  35. * @param int $timestamp
  36. * The workspace creation timestamp.
  37. *
  38. * @return $this
  39. */
  40. public function setCreatedTime($timestamp);
  41. }