You are here

public function PathFileEntity::setPublished in Path File 8

Sets the published status of a Path file entity.

Parameters

bool $published: TRUE to set this Path file entity to published, FALSE to set it to unpublished.

Return value

\Drupal\path_file\Entity\PathFileEntityInterface The called Path file entity entity.

Overrides PathFileEntityInterface::setPublished

File

src/Entity/PathFileEntity.php, line 139

Class

PathFileEntity
Defines the Path file entity entity.

Namespace

Drupal\path_file\Entity

Code

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