Centralize some of the database function (linked to the normalized search). re #48, #49

This commit is contained in:
Sébastien Lucas 2014-05-28 16:13:57 +02:00
parent 81fbe584db
commit 9aee96d7e2
8 changed files with 12 additions and 9 deletions

View file

@ -428,13 +428,12 @@ class Book extends Base {
}
public static function getBookCount($database = NULL) {
$nBooks = parent::getDb ($database)->query('select count(*) from books')->fetchColumn();
return $nBooks;
return parent::executeQuerySingle ('select count(*) from books', $database);
}
public static function getCount() {
global $config;
$nBooks = parent::getDb ()->query('select count(*) from books')->fetchColumn();
$nBooks = parent::executeQuerySingle ('select count(*) from books');
$result = array();
$entry = new Entry (localize ("allbooks.title"),
self::ALL_BOOKS_ID,