You are here

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

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 242
Contains \Drupal\node\Entity\Node.

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;
}