Node::setPromoted

public Node::setPromoted($promoted)

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 226

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;
}
doc_Drupal
2016-10-29 09:30:24
Comments
Leave a Comment

Please login to continue.