Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Entity/EntityPublishedInterface.php \Drupal\Core\Entity\EntityPublishedInterface
  2. 9 core/lib/Drupal/Core/Entity/EntityPublishedInterface.php \Drupal\Core\Entity\EntityPublishedInterface

Provides an interface for access to an entity's published state.

Hierarchy

Expanded class hierarchy of EntityPublishedInterface

All classes that implement EntityPublishedInterface

23 files declare their use of EntityPublishedInterface
BlockContentInterface.php in core/modules/block_content/src/BlockContentInterface.php
CommentInterface.php in core/modules/comment/src/CommentInterface.php
CommonCollectionFilterAccessTestPatternsTrait.php in core/modules/jsonapi/tests/src/Traits/CommonCollectionFilterAccessTestPatternsTrait.php
ContentModeration.php in core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php
ContentModerationStateTest.php in core/modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php

... See full list

File

core/lib/Drupal/Core/Entity/EntityPublishedInterface.php, line 8

Namespace

Drupal\Core\Entity
View source
interface EntityPublishedInterface extends EntityInterface {

  /**
   * 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();

}

Members