- add book data to more like this results
- allow to specify number of books
This commit is contained in:
@@ -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.0.7';
|
public static $version = '1.0.8';
|
||||||
|
|
||||||
private $login = '';
|
private $login = '';
|
||||||
private $client = 'website';
|
private $client = 'website';
|
||||||
@@ -715,15 +715,16 @@ class NetBiblio extends WebService
|
|||||||
* This method return books similar to the one given.
|
* This method return books similar to the one given.
|
||||||
*
|
*
|
||||||
* @param int|array $ids One or multiple book ids
|
* @param int|array $ids One or multiple book ids
|
||||||
|
* @param int number of books
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function MoreLikeThis($ids)
|
public function MoreLikeThis($ids, $number = 5)
|
||||||
{
|
{
|
||||||
$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');
|
||||||
$bs->setHandler('more');
|
$bs->setHandler('more');
|
||||||
$results = $bs->getResults(0, 5);
|
$results = $bs->getResults(0, $number);
|
||||||
return $results['books'];
|
return $this->AddBookData($results['books']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user