mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 23:30:35 -04:00
Use 'insert ... returning' instead of 'Db::GetLastInsertedId()'
This commit is contained in:
parent
4446b6d161
commit
5066252355
12 changed files with 44 additions and 57 deletions
|
@ -347,7 +347,7 @@ final class Project{
|
|||
throw new Exceptions\ProjectExistsException();
|
||||
}
|
||||
|
||||
Db::Query('
|
||||
$this->ProjectId = Db::QueryInt('
|
||||
INSERT into Projects
|
||||
(
|
||||
EbookId,
|
||||
|
@ -384,10 +384,9 @@ final class Project{
|
|||
?,
|
||||
?
|
||||
)
|
||||
returning ProjectId
|
||||
', [$this->EbookId, $this->Status, $this->ProducerName, $this->ProducerEmail, $this->DiscussionUrl, $this->VcsUrl, NOW, NOW, $this->Started, $this->Ended, $this->ManagerUserId, $this->ReviewerUserId, $this->LastCommitTimestamp, $this->LastDiscussionTimestamp, $this->IsStatusAutomaticallyUpdated]);
|
||||
|
||||
$this->ProjectId = Db::GetLastInsertedId();
|
||||
|
||||
// Notify the manager and reviewer.
|
||||
if($this->Status == Enums\ProjectStatusType::InProgress){
|
||||
// The manager is also the reviewer, just send one email.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue