EntityPublishedInterface.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace Drupal\Core\Entity;
  3. /**
  4. * Provides an interface for access to an entity's published state.
  5. */
  6. interface EntityPublishedInterface {
  7. /**
  8. * Returns whether or not the entity is published.
  9. *
  10. * @return bool
  11. * TRUE if the entity is published, FALSE otherwise.
  12. */
  13. public function isPublished();
  14. /**
  15. * Sets the entity as published.
  16. *
  17. * @param bool|null $published
  18. * (optional and deprecated) TRUE to set this entity to published, FALSE to
  19. * set it to unpublished. Defaults to NULL. This parameter is deprecated in
  20. * Drupal 8.3.0 and will be removed before Drupal 9.0.0. Use this method,
  21. * without any parameter, to set the entity as published and
  22. * setUnpublished() to set the entity as unpublished.
  23. *
  24. * @return $this
  25. *
  26. * @see \Drupal\Core\Entity\EntityPublishedInterface::setUnpublished()
  27. */
  28. public function setPublished($published = NULL);
  29. /**
  30. * Sets the entity as unpublished.
  31. *
  32. * @return $this
  33. */
  34. public function setUnpublished();
  35. }