3 namespace Drupal\Core\Entity;
6 * Provides an interface for access to an entity's published state.
8 interface EntityPublishedInterface {
11 * Returns whether or not the entity is published.
14 * TRUE if the entity is published, FALSE otherwise.
16 public function isPublished();
19 * Sets the entity as published.
21 * @param bool|null $published
22 * (optional and deprecated) TRUE to set this entity to published, FALSE to
23 * set it to unpublished. Defaults to NULL. This parameter is deprecated in
24 * Drupal 8.3.0 and will be removed before Drupal 9.0.0. Use this method,
25 * without any parameter, to set the entity as published and
26 * setUnpublished() to set the entity as unpublished.
30 * @see \Drupal\Core\Entity\EntityPublishedInterface::setUnpublished()
32 public function setPublished($published = NULL);
35 * Sets the entity as unpublished.
39 public function setUnpublished();