Centralize a little the code

Should be easier to add the count of element. re #79
This commit is contained in:
Sébastien Lucas 2014-06-02 21:31:55 +02:00
parent 86999dd3ec
commit 270c281741
3 changed files with 30 additions and 50 deletions

View file

@ -1266,6 +1266,19 @@ abstract class Base
return $entry;
}
public static function getEntryArrayWithBookNumber ($query, $columns, $params, $category) {
list (, $result) = self::executeQuery ($query, $columns, "", $params, -1);
$entryArray = array();
while ($post = $result->fetchObject ())
{
$instance = new $category ($post);
array_push ($entryArray, new Entry ($post->sort, $instance->getEntryId (),
str_format (localize("bookword", $post->count), $post->count), "text",
array ( new LinkNavigation ($instance->getUri ())), "", $post->count));
}
return $entryArray;
}
public static function executeQuery($query, $columns, $filter, $params, $n, $database = NULL, $numberPerPage = NULL) {
$totalResult = -1;