Version 1
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityPublishedInterface.php
1 <?php
2
3 namespace Drupal\Core\Entity;
4
5 /**
6  * Provides an interface for access to an entity's published state.
7  */
8 interface EntityPublishedInterface {
9
10   /**
11    * Returns whether or not the entity is published.
12    *
13    * @return bool
14    *   TRUE if the entity is published, FALSE otherwise.
15    */
16   public function isPublished();
17
18   /**
19    * Sets the entity as published.
20    *
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.
27    *
28    * @return $this
29    *
30    * @see \Drupal\Core\Entity\EntityPublishedInterface::setUnpublished()
31    */
32   public function setPublished($published = NULL);
33
34   /**
35    * Sets the entity as unpublished.
36    *
37    * @return $this
38    */
39   public function setUnpublished();
40
41 }