created = new DrupalDateTime($time); return $this; } public function setTitle(string $title): self { $this->title = $title; return $this; } public function getPost(): NodeInterface { $post = Node::create([ 'title' => $this->title, 'type' => 'post', ]); if ($this->created !== NULL) { $post->setCreatedTime($this->created->getTimestamp()); } $post->save(); return $post; } }