You are here

public function Node::setCreatedTime in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/node/src/Entity/Node.php \Drupal\node\Entity\Node::setCreatedTime()

Sets the node creation timestamp.

Parameters

int $timestamp: The node creation timestamp.

Return value

$this The called node entity.

Overrides NodeInterface::setCreatedTime

File

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

Class

Node
Defines the node entity class.

Namespace

Drupal\node\Entity

Code

public function setCreatedTime($timestamp) {
  $this
    ->set('created', $timestamp);
  return $this;
}