Node::setSticky

public Node::setSticky($sticky)

Sets the node sticky status.

Parameters

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

Return value

\Drupal\node\NodeInterface The called node entity.

Overrides NodeInterface::setSticky

File

core/modules/node/src/Entity/Node.php, line 241

Class

Node
Defines the node entity class.

Namespace

Drupal\node\Entity

Code

public function setSticky($sticky) {
  $this->set('sticky', $sticky ? NODE_STICKY : NODE_NOT_STICKY);
  return $this;
}
doc_Drupal
2016-10-29 09:30:26
Comments
Leave a Comment

Please login to continue.