Centralize a little the code
Should be easier to add the count of element. re #79
This commit is contained in:
parent
86999dd3ec
commit
270c281741
3 changed files with 30 additions and 50 deletions
13
base.php
13
base.php
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue