You are here

public function Node::setPromoted 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::setPromoted()

Sets the node promoted status.

Parameters

bool $promoted: TRUE to set this node to promoted, FALSE to set it to not promoted.

Return value

\Drupal\node\NodeInterface The called node entity.

Overrides NodeInterface::setPromoted

File

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

Class

Node
Defines the node entity class.

Namespace

Drupal\node\Entity

Code

public function setPromoted($promoted) {
  $this
    ->set('promote', $promoted ? NODE_PROMOTED : NODE_NOT_PROMOTED);
  return $this;
}