public Node::setPublished($published)
Sets the published status of a node..
Parameters
bool $published: TRUE to set this node to published, FALSE to set it to unpublished.
Return value
\Drupal\node\NodeInterface The called node entity.
Overrides NodeInterface::setPublished
File
- core/modules/node/src/Entity/Node.php, line 255
Class
- Node
- Defines the node entity class.
Namespace
Drupal\node\Entity
Code
public function setPublished($published) { $this->set('status', $published ? NODE_PUBLISHED : NODE_NOT_PUBLISHED); return $this; }
Please login to continue.