mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 10:56:46 -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
|
@ -720,7 +720,7 @@ class Artwork{
|
|||
|
||||
$this->Artist = Artist::GetOrCreate($this->Artist);
|
||||
|
||||
Db::Query('
|
||||
$this->ArtworkId = Db::QueryInt('
|
||||
INSERT into
|
||||
Artworks (ArtistId, Name, UrlName, CompletedYear, CompletedYearIsCirca, Created, Updated, Status, SubmitterUserId, ReviewerUserId, MuseumUrl,
|
||||
PublicationYear, PublicationYearPageUrl, CopyrightPageUrl, ArtworkPageUrl, IsPublishedInUs,
|
||||
|
@ -745,13 +745,12 @@ class Artwork{
|
|||
?,
|
||||
?,
|
||||
?)
|
||||
returning ArtworkId
|
||||
', [$this->Artist->ArtistId, $this->Name, $this->UrlName, $this->CompletedYear, $this->CompletedYearIsCirca,
|
||||
$this->Created, $this->Updated, $this->Status, $this->SubmitterUserId, $this->ReviewerUserId, $this->MuseumUrl, $this->PublicationYear, $this->PublicationYearPageUrl,
|
||||
$this->CopyrightPageUrl, $this->ArtworkPageUrl, $this->IsPublishedInUs, $this->EbookUrl, $this->MimeType, $this->Exception, $this->Notes]
|
||||
);
|
||||
|
||||
$this->ArtworkId = Db::GetLastInsertedId();
|
||||
|
||||
foreach($this->Tags as $tag){
|
||||
Db::Query('
|
||||
INSERT into ArtworkTags (ArtworkId, TagId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue