First attempt to add paging in the OPDS side.

Need more polishing before being used everywhere.

--HG--
extra : rebase_source : 0fb3a4b12cf83d4b450a1fca81f82addd8d58c14
This commit is contained in:
Sébastien Lucas 2012-09-18 15:39:22 +02:00
parent 43f489051d
commit 4c9e8c67d0
5 changed files with 67 additions and 27 deletions

View file

@ -363,19 +363,17 @@ order by substr (upper (sort), 1, 1)");
return $entryArray;
}
public static function getBooksByStartingLetter($letter) {
$result = parent::getDb ()->prepare('select ' . self::BOOK_COLUMNS . '
public static function getBooksByStartingLetter($letter, $n) {
list ($totalNumber, $result) = parent::executeQuery ('select {0}
from books left outer join comments on book = books.id
where upper (books.sort) like ?');
where upper (books.sort) like ?', self::BOOK_COLUMNS, array ($letter . "%"), $n);
$entryArray = array();
$queryLike = $letter . "%";
$result->execute (array ($queryLike));
while ($post = $result->fetchObject ())
{
$book = new Book ($post);
array_push ($entryArray, $book->getEntry ());
}
return $entryArray;
return array ($entryArray, $totalNumber);
}