mirror of
https://github.com/standardebooks/web.git
synced 2025-07-10 00:30:28 -04:00
Explicitly set sort order for sources, contributors, and toc entries
This is just to avoid any future undefined behavior. The current DB table implementation returns these rows in insertion order, but it might not be wise to depend on that. Either way, the result sets of these queries are small and can be sorted quickly.
This commit is contained in:
parent
7d8cfd351e
commit
59eee3cc57
1 changed files with 6 additions and 0 deletions
|
@ -193,6 +193,7 @@ class Ebook{
|
|||
SELECT *
|
||||
from EbookSources
|
||||
where EbookId = ?
|
||||
order by EbookSourceId
|
||||
', [$this->EbookId], EbookSource::class);
|
||||
}
|
||||
|
||||
|
@ -209,6 +210,7 @@ class Ebook{
|
|||
from Contributors
|
||||
where EbookId = ?
|
||||
and MarcRole = ?
|
||||
order by ContributorId
|
||||
', [$this->EbookId, 'aut'], Contributor::class);
|
||||
}
|
||||
|
||||
|
@ -225,6 +227,7 @@ class Ebook{
|
|||
from Contributors
|
||||
where EbookId = ?
|
||||
and MarcRole = ?
|
||||
order by ContributorId
|
||||
', [$this->EbookId, 'ill'], Contributor::class);
|
||||
}
|
||||
|
||||
|
@ -241,6 +244,7 @@ class Ebook{
|
|||
from Contributors
|
||||
where EbookId = ?
|
||||
and MarcRole = ?
|
||||
order by ContributorId
|
||||
', [$this->EbookId, 'trl'], Contributor::class);
|
||||
}
|
||||
|
||||
|
@ -257,6 +261,7 @@ class Ebook{
|
|||
from Contributors
|
||||
where EbookId = ?
|
||||
and MarcRole = ?
|
||||
order by ContributorId
|
||||
', [$this->EbookId, 'ctb'], Contributor::class);
|
||||
}
|
||||
|
||||
|
@ -274,6 +279,7 @@ class Ebook{
|
|||
SELECT *
|
||||
from TocEntries
|
||||
where EbookId = ?
|
||||
order by TocEntryId
|
||||
', [$this->EbookId], stdClass::class);
|
||||
|
||||
foreach($result as $row){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue