Contributor, EbookSource, GitCommit: Move INSERT statements to Create() methods

This commit is contained in:
Mike Colagrosso 2024-10-03 22:46:53 -06:00 committed by Alex Cabal
parent 4aefe412f9
commit 2378320d0c
4 changed files with 45 additions and 37 deletions

View file

@ -23,4 +23,16 @@ class GitCommit{
$instance->Hash = $hash;
return $instance;
}
public function Create(): void{
Db::Query('
INSERT into GitCommits (EbookId, Created, Message, Hash)
values (?,
?,
?,
?)
', [$this->EbookId, $this->Created, $this->Message, $this->Hash]);
$this->GitCommitId = Db::GetLastInsertedId();
}
}