Same name and namespace in other branches
  1. 8.9.x core/modules/node/src/Entity/Node.php \Drupal\node\Entity\Node::setCreatedTime()
  2. 9 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 224

Class

Node
Defines the node entity class.

Namespace

Drupal\node\Entity

Code

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