You are here

public function Keyword::setPublished in Alinks 8

Sets the published status of a Keyword.

Parameters

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

Return value

\Drupal\alinks\Entity\KeywordInterface The called Keyword entity.

Overrides KeywordInterface::setPublished

File

src/Entity/Keyword.php, line 143

Class

Keyword
Defines the Keyword entity.

Namespace

Drupal\alinks\Entity

Code

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