mirror of
https://github.com/standardebooks/web.git
synced 2025-07-05 22:30:30 -04:00
Add endpoint to get reviewer for an in-progress project
This commit is contained in:
parent
87620287f1
commit
bc16b1fff8
5 changed files with 110 additions and 2 deletions
|
@ -675,6 +675,17 @@ final class Project{
|
|||
return Db::Query('SELECT * from Projects where ProjectId = ?', [$projectId], Project::class)[0] ?? throw new Exceptions\ProjectNotFoundException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exceptions\ProjectNotFoundException If the `Project` can't be found.
|
||||
*/
|
||||
public static function GetByIdentifierAndIsInProgress(?string $identifier): Project{
|
||||
if($identifier === null){
|
||||
throw new Exceptions\ProjectNotFoundException();
|
||||
}
|
||||
|
||||
return Db::Query('SELECT Projects.* from Ebooks inner join Projects using (EbookId) where Ebooks.Identifier = ? and Projects.Status = ?', [$identifier, Enums\ProjectStatusType::InProgress], Project::class)[0] ?? throw new Exceptions\ProjectNotFoundException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<Project>
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue