You are here

public function SiteSettingEntity::setPublished in Site Settings and Labels 8

Sets the published status of a Site Setting.

Parameters

bool $published: TRUE to set this Site Setting to published, FALSE to set it to unpublished.

Return value

\Drupal\site_settings\SiteSettingEntityInterface The called Site Setting entity.

Overrides SiteSettingEntityInterface::setPublished

File

src/Entity/SiteSettingEntity.php, line 178

Class

SiteSettingEntity
Defines the Site Setting entity.

Namespace

Drupal\site_settings\Entity

Code

public function setPublished($published) {
  $this
    ->set('status', $published ? NodeInterface::PUBLISHED : NodeInterface::NOT_PUBLISHED);
  return $this;
}