add a specific method to speed up Dashboard display
This commit is contained in:
@@ -13,7 +13,7 @@ use BSR\Lib\WebService;
|
||||
class NetBiblio extends WebService
|
||||
{
|
||||
/** @var string $version version number */
|
||||
public static $version = '1.1.3';
|
||||
public static $version = '1.1.4';
|
||||
|
||||
private $login = '';
|
||||
private $client = 'website';
|
||||
@@ -473,6 +473,30 @@ class NetBiblio extends WebService
|
||||
return array_values($this->AddBookData($circulations));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method return information for the user dashboard :
|
||||
*
|
||||
* ° 'loans' : number of current loans
|
||||
* ° 'oldLoans' : number of past loans
|
||||
* ° 'wishes' : number of wishes
|
||||
* ° 'novelties' : new books
|
||||
* ° 'recommendations' : recommended books
|
||||
*
|
||||
* @return array
|
||||
* @throws AuthenticationException
|
||||
*/
|
||||
public function GetDashboardData()
|
||||
{
|
||||
$user = $this->getUser();
|
||||
return array(
|
||||
'loans' => $user->GetLoans(true),
|
||||
'oldLoans' => $user->GetOldLoans(true),
|
||||
'wishes' => $user->getWishes(true),
|
||||
'novelties' => $this->LastBooksByType('', 15),
|
||||
'recommendations' => $this->MoreLikeLoans(),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method adds a book to the currently authenticated user wishlist
|
||||
* based on its code.
|
||||
|
||||
Reference in New Issue
Block a user