summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/Entity/EntityPublishedInterface.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/lib/Drupal/Core/Entity/EntityPublishedInterface.php')
-rw-r--r--core/lib/Drupal/Core/Entity/EntityPublishedInterface.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/core/lib/Drupal/Core/Entity/EntityPublishedInterface.php b/core/lib/Drupal/Core/Entity/EntityPublishedInterface.php
new file mode 100644
index 0000000..4372008
--- /dev/null
+++ b/core/lib/Drupal/Core/Entity/EntityPublishedInterface.php
@@ -0,0 +1,41 @@
+<?php
+
+namespace Drupal\Core\Entity;
+
+/**
+ * Provides an interface for access to an entity's published state.
+ */
+interface EntityPublishedInterface {
+
+ /**
+ * Returns whether or not the entity is published.
+ *
+ * @return bool
+ * TRUE if the entity is published, FALSE otherwise.
+ */
+ public function isPublished();
+
+ /**
+ * Sets the entity as published.
+ *
+ * @param bool|null $published
+ * (optional and deprecated) TRUE to set this entity to published, FALSE to
+ * set it to unpublished. Defaults to NULL. This parameter is deprecated in
+ * Drupal 8.3.0 and will be removed before Drupal 9.0.0. Use this method,
+ * without any parameter, to set the entity as published and
+ * setUnpublished() to set the entity as unpublished.
+ *
+ * @return $this
+ *
+ * @see \Drupal\Core\Entity\EntityPublishedInterface::setUnpublished()
+ */
+ public function setPublished($published = NULL);
+
+ /**
+ * Sets the entity as unpublished.
+ *
+ * @return $this
+ */
+ public function setUnpublished();
+
+}