You are here

public function Node::isPublished in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Entity/Node.php \Drupal\node\Entity\Node::isPublished()

Returns the node published status indicator.

Unpublished nodes are only visible to their authors and to administrators.

Return value

bool TRUE if the node is published.

Overrides NodeInterface::isPublished

File

core/modules/node/src/Entity/Node.php, line 249
Contains \Drupal\node\Entity\Node.

Class

Node
Defines the node entity class.

Namespace

Drupal\node\Entity

Code

public function isPublished() {
  return (bool) $this
    ->getEntityKey('status');
}