restore LastBooksByType

This commit is contained in:
Gilles Crettenand
2015-05-20 16:27:28 +02:00
parent 71b2af844f
commit 3400132b1b

View File

@@ -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;