From 3400132b1bd8187368e79994106fb99500934d81 Mon Sep 17 00:00:00 2001 From: Gilles Crettenand Date: Wed, 20 May 2015 16:27:28 +0200 Subject: [PATCH] restore LastBooksByType --- mobile.netbiblio.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mobile.netbiblio.php b/mobile.netbiblio.php index 5d80b01..b35d437 100644 --- a/mobile.netbiblio.php +++ b/mobile.netbiblio.php @@ -383,6 +383,25 @@ class NetBiblio extends WebService $this->data = AudioBook::inReading(); } + public function LastBooksByType($type, $itemsByGroup) + { + $this->CheckSession(); + + $s = new BookSearch(); + if($type == 'Jeunesse') { + $s->addQuery(1, 'jeunesse'); + } else { + $s->addQuery($type, 'category'); + } + $s->addSortField('availabilityDate'); + + $results = $s->getResults(0, $itemsByGroup); + + $ids = array_map(function($r) { return $r['id']; }, $results['response']['docs']); + $books = AudioBook::findBy('NoticeID', $ids, true); + $this->data = array_map(array($this, 'AddFiles'), $books); + } + protected function Output() { return $this->data;