mirror of
https://github.com/standardebooks/web.git
synced 2025-07-22 07:14:59 -04:00
Refactor functions out of Library
This commit is contained in:
parent
1449148989
commit
b7b63a4be5
24 changed files with 419 additions and 444 deletions
|
@ -12,7 +12,7 @@ try{
|
|||
throw new Exceptions\AuthorNotFoundException();
|
||||
}
|
||||
|
||||
$ebooks = Library::GetEbooksByAuthor($urlPath);
|
||||
$ebooks = Ebook::GetAllByAuthor($urlPath);
|
||||
|
||||
if(sizeof($ebooks) == 0){
|
||||
throw new Exceptions\AuthorNotFoundException();
|
||||
|
|
|
@ -68,7 +68,7 @@ try{
|
|||
if(sizeof($ebook->Tags) > 0){
|
||||
$carouselTag = $ebook->Tags[rand(0, sizeof($ebook->Tags) - 1)];
|
||||
}
|
||||
$carousel = Library::GetRelatedEbooks($ebook, $targetCarouselSize, $carouselTag);
|
||||
$carousel = Ebook::GetAllByRelated($ebook, $targetCarouselSize, $carouselTag);
|
||||
}
|
||||
catch(Exceptions\SeeOtherEbookException $ex){
|
||||
http_response_code(301);
|
||||
|
|
|
@ -35,7 +35,7 @@ try{
|
|||
$tags = [];
|
||||
}
|
||||
|
||||
$result = Library::FilterEbooks($query != '' ? $query : null, $tags, $sort, $page, $perPage);
|
||||
$result = Ebook::GetAllByFilter($query != '' ? $query : null, $tags, $sort, $page, $perPage);
|
||||
$ebooks = $result['ebooks'];
|
||||
$totalEbooks = $result['ebooksCount'];
|
||||
$pageTitle = 'Browse Standard Ebooks';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue