mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 14:20:29 -04:00
Add missing MultiTableSelect code
This commit is contained in:
parent
d0d79d637c
commit
93b8008c7e
4 changed files with 24 additions and 6 deletions
|
@ -652,21 +652,21 @@ final class Project{
|
|||
* @return array<Project>
|
||||
*/
|
||||
public static function GetAllByStatus(Enums\ProjectStatusType $status): array{
|
||||
return Db::Query('SELECT * from Projects inner join Ebooks using (EbookId) where Projects.Status = ? order by Title asc', [$status], Project::class);
|
||||
return Db::MultiTableSelect('SELECT * from Projects inner join Ebooks using (EbookId) where Projects.Status = ? order by Title asc', [$status], Project::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Project>
|
||||
*/
|
||||
public static function GetAllByManagerUserId(int $userId): array{
|
||||
return Db::Query('SELECT * from Projects inner join Ebooks using (EbookId) where ManagerUserId = ? and Status in (?, ?) order by Title asc', [$userId, Enums\ProjectStatusType::InProgress, Enums\ProjectStatusType::Stalled], Project::class);
|
||||
return Db::MultiTableSelect('SELECT * from Projects inner join Ebooks using (EbookId) where ManagerUserId = ? and Status in (?, ?) order by Title asc', [$userId, Enums\ProjectStatusType::InProgress, Enums\ProjectStatusType::Stalled], Project::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Project>
|
||||
*/
|
||||
public static function GetAllByReviewerUserId(int $userId): array{
|
||||
return Db::Query('SELECT * from Projects inner join Ebooks using (EbookId) where ReviewerUserId = ? and Status in (?, ?) order by Title asc', [$userId, Enums\ProjectStatusType::InProgress, Enums\ProjectStatusType::Stalled], Project::class);
|
||||
return Db::MultiTableSelect('SELECT * from Projects inner join Ebooks using (EbookId) where ReviewerUserId = ? and Status in (?, ?) order by Title asc', [$userId, Enums\ProjectStatusType::InProgress, Enums\ProjectStatusType::Stalled], Project::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -677,9 +677,8 @@ final class Project{
|
|||
public static function FromMultiTableRow(array $row): Project{
|
||||
$object = Project::FromRow($row['Projects']);
|
||||
|
||||
// The Action may be null if it's a Scribophile adjustment. In that case, don't initialize the Action object.
|
||||
if($row['Ebooks']->EbookId !== null){
|
||||
$row['Ebooks']->Ebookid = $object->EbookId;
|
||||
$row['Ebooks']->EbookId = $object->EbookId;
|
||||
$object->Ebook = Ebook::FromRow($row['Ebooks']);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue