Fix integrity constraint violation error

This commit is contained in:
Oliver Davies 2024-01-17 10:49:02 +00:00
parent 86b5c18f8d
commit 7d79a2ea14

View file

@ -34,11 +34,14 @@ final class PostBuilder {
public function getPost(): NodeInterface {
$post = Node::create([
'created' => $this?->created->getTimestamp(),
'title' => $this->title,
'type' => 'post',
]);
if ($this->created !== NULL) {
$post->setCreatedTime($this->created->getTimestamp());
}
$post->save();
return $post;