You are here

public function EntityPublishedTrait::setUnpublished in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/EntityPublishedTrait.php \Drupal\Core\Entity\EntityPublishedTrait::setUnpublished()
  2. 9 core/lib/Drupal/Core/Entity/EntityPublishedTrait.php \Drupal\Core\Entity\EntityPublishedTrait::setUnpublished()

File

core/lib/Drupal/Core/Entity/EntityPublishedTrait.php, line 64

Class

EntityPublishedTrait
Provides a trait for published status.

Namespace

Drupal\Core\Entity

Code

public function setUnpublished() {
  $key = $this
    ->getEntityType()
    ->getKey('published');
  $this
    ->set($key, FALSE);
  return $this;
}