public function Node::setSticky in Drupal 9
Same name and namespace in other branches
- 8 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
$this The called node entity.
Overrides NodeInterface::setSticky
File
- core/
modules/ node/ src/ Entity/ Node.php, line 253
Class
- Node
- Defines the node entity class.
Namespace
Drupal\node\EntityCode
public function setSticky($sticky) {
$this
->set('sticky', $sticky ? NodeInterface::STICKY : NodeInterface::NOT_STICKY);
return $this;
}