- add book data to more like this results

- allow to specify number of books
master
Gilles Crettenand 11 years ago
parent 503f5d4037
commit c00253d47d

@ -13,7 +13,7 @@ use BSR\Lib\WebService;
class NetBiblio extends WebService
{
/** @var string $version version number */
public static $version = '1.0.7';
public static $version = '1.0.8';
private $login = '';
private $client = 'website';
@ -715,15 +715,16 @@ class NetBiblio extends WebService
* This method return books similar to the one given.
*
* @param int|array $ids One or multiple book ids
* @param int number of books
* @return array
*/
public function MoreLikeThis($ids)
public function MoreLikeThis($ids, $number = 5)
{
$bs = new BookSearch(false);
$bs->addOrQuery(is_array($ids) ? $ids : array($ids), 'id');
$bs->setHandler('more');
$results = $bs->getResults(0, 5);
return $results['books'];
$results = $bs->getResults(0, $number);
return $this->AddBookData($results['books']);
}
/**

Loading…
Cancel
Save