Fix integrity constraint violation error
This commit is contained in:
parent
86b5c18f8d
commit
7d79a2ea14
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue