EntityPublishedInterface.php

Same filename in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityPublishedInterface.php
  2. 10 core/lib/Drupal/Core/Entity/EntityPublishedInterface.php
  3. 11.x core/lib/Drupal/Core/Entity/EntityPublishedInterface.php

Namespace

Drupal\Core\Entity

File

core/lib/Drupal/Core/Entity/EntityPublishedInterface.php

View source
<?php

namespace Drupal\Core\Entity;


/**
 * Provides an interface for access to an entity's published state.
 *
 * @ingroup entity_type_characteristics
 */
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.
     *
     * @return $this
     *
     * @see \Drupal\Core\Entity\EntityPublishedInterface::setUnpublished()
     */
    public function setPublished();
    
    /**
     * Sets the entity as unpublished.
     *
     * @return $this
     */
    public function setUnpublished();

}

Interfaces

Title Deprecated Summary
EntityPublishedInterface Provides an interface for access to an entity's published state.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.