public function EntityPublishedTrait::setPublished in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/EntityPublishedTrait.php \Drupal\Core\Entity\EntityPublishedTrait::setPublished()
- 9 core/lib/Drupal/Core/Entity/EntityPublishedTrait.php \Drupal\Core\Entity\EntityPublishedTrait::setPublished()
File
- core/
lib/ Drupal/ Core/ Entity/ EntityPublishedTrait.php, line 54
Class
- EntityPublishedTrait
- Provides a trait for published status.
Namespace
Drupal\Core\EntityCode
public function setPublished() {
$key = $this
->getEntityType()
->getKey('published');
$this
->set($key, TRUE);
return $this;
}