default values

This commit is contained in:
Gilles Crettenand
2015-06-19 13:56:23 +02:00
parent cae5f7cb7c
commit e4b5454c72

View File

@@ -13,7 +13,7 @@ use BSR\Lib\WebService;
class NetBiblio extends WebService class NetBiblio extends WebService
{ {
/** @var string $version version number */ /** @var string $version version number */
public static $version = '1.1.4'; public static $version = '1.1.5';
private $login = ''; private $login = '';
private $client = 'website'; private $client = 'website';
@@ -492,8 +492,8 @@ class NetBiblio extends WebService
'loans' => $user->GetLoans(true), 'loans' => $user->GetLoans(true),
'oldLoans' => $user->GetOldLoans(true), 'oldLoans' => $user->GetOldLoans(true),
'wishes' => $user->getWishes(true), 'wishes' => $user->getWishes(true),
'novelties' => $this->LastBooksByType('', 15), 'novelties' => $this->LastBooksByType('', 12),
'recommendations' => $this->MoreLikeLoans(), 'recommendations' => $this->MoreLikeLoans(8),
); );
} }
@@ -749,7 +749,7 @@ class NetBiblio extends WebService
* @param int number of books * @param int number of books
* @return array * @return array
*/ */
public function MoreLikeThis($ids, $number = 5) public function MoreLikeThis($ids, $number = 8)
{ {
$bs = new BookSearch(false); $bs = new BookSearch(false);
$bs->addOrQuery(is_array($ids) ? $ids : array($ids), 'id'); $bs->addOrQuery(is_array($ids) ? $ids : array($ids), 'id');
@@ -762,14 +762,15 @@ class NetBiblio extends WebService
* This method returns books similar to the books already * This method returns books similar to the books already
* loaned by the current user. * loaned by the current user.
* *
* @param int number of books
* @return array * @return array
* @throws AuthenticationException * @throws AuthenticationException
*/ */
public function MoreLikeLoans() public function MoreLikeLoans($number = 8)
{ {
$circulations = $this->getUser()->getLoansData('OldCirculations'); $circulations = $this->getUser()->getLoansData('OldCirculations');
$ids = array_map(function($c) { return $c['NoticeId']; }, $circulations); $ids = array_map(function($c) { return $c['NoticeId']; }, $circulations);
return $this->MoreLikeThis($ids); return $this->MoreLikeThis($ids, $number);
} }
/** /**