You are here

public function Status::setPublished in Heartbeat 8

Sets the published status of a Status.

Parameters

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

Return value

\Drupal\statusmessage\StatusInterface The called Status entity.

Overrides StatusInterface::setPublished

File

modules/statusmessage/src/Entity/Status.php, line 151

Class

Status

Namespace

Drupal\statusmessage\Entity

Code

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