Replace Library::GetEbookByIdentifier with Ebook::GetByIdentifier

The new method throws an exception instead of returning null.
This commit is contained in:
Mike Colagrosso 2024-04-25 22:58:01 -06:00 committed by Alex Cabal
parent 7350891cd5
commit 572fd90fed
2 changed files with 25 additions and 26 deletions

View file

@ -673,24 +673,6 @@ class Library{
}
}
public static function GetEbookByIdentifier(?string $identifier): ?Ebook{
if($identifier === null){
return null;
}
$result = Db::Query('
SELECT *
from Ebooks
where Identifier = ?
', [$identifier], 'Ebook');
if(sizeof($result) == 0){
return null;
}
return $result[0];
}
/**
* @throws Exceptions\AppException
*/