| @@ 45-58 (lines=14) @@ | ||
| 42 | return parent::getCountGeneric ("authors", self::ALL_AUTHORS_ID, parent::PAGE_ALL_AUTHORS); |
|
| 43 | } |
|
| 44 | ||
| 45 | public static function getAllAuthorsByFirstLetter() { |
|
| 46 | list (, $result) = parent::executeQuery ("select {0} |
|
| 47 | from authors |
|
| 48 | group by substr (upper (sort), 1, 1) |
|
| 49 | order by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", "", array (), -1); |
|
| 50 | $entryArray = array(); |
|
| 51 | while ($post = $result->fetchObject ()) |
|
| 52 | { |
|
| 53 | array_push ($entryArray, new Entry ($post->title, Author::getEntryIdByLetter ($post->title), |
|
| 54 | str_format (localize("authorword", $post->count), $post->count), "text", |
|
| 55 | array ( new LinkNavigation ("?page=".parent::PAGE_AUTHORS_FIRST_LETTER."&id=". rawurlencode ($post->title))), "", $post->count)); |
|
| 56 | } |
|
| 57 | return $entryArray; |
|
| 58 | } |
|
| 59 | ||
| 60 | public static function getAuthorsByStartingLetter($letter) { |
|
| 61 | return self::getEntryArray (self::SQL_AUTHORS_BY_FIRST_LETTER, array ($letter . "%")); |
|
| @@ 584-600 (lines=17) @@ | ||
| 581 | return array($entryArray, $totalNumber); |
|
| 582 | } |
|
| 583 | ||
| 584 | public static function getAllBooks() { |
|
| 585 | /* @var $result PDOStatement */ |
|
| 586 | ||
| 587 | list (, $result) = parent::executeQuery('select {0} |
|
| 588 | from books |
|
| 589 | group by substr (upper (sort), 1, 1) |
|
| 590 | order by substr (upper (sort), 1, 1)', 'substr (upper (sort), 1, 1) as title, count(*) as count', self::getFilterString(), array(), -1); |
|
| 591 | ||
| 592 | $entryArray = array(); |
|
| 593 | while ($post = $result->fetchObject()) |
|
| 594 | { |
|
| 595 | array_push($entryArray, new Entry($post->title, Book::getEntryIdByLetter($post->title), |
|
| 596 | str_format(localize('bookword', $post->count), $post->count), 'text', |
|
| 597 | array(new LinkNavigation('?page='.parent::PAGE_ALL_BOOKS_LETTER.'&id='. rawurlencode($post->title))), '', $post->count)); |
|
| 598 | } |
|
| 599 | return $entryArray; |
|
| 600 | } |
|
| 601 | ||
| 602 | public static function getBooksByStartingLetter($letter, $n, $database = NULL, $numberPerPage = NULL) { |
|
| 603 | return self::getEntryArray(self::SQL_BOOKS_BY_FIRST_LETTER, array($letter . '%'), $n, $database, $numberPerPage); |
|