more phpdoc

master
Gilles Crettenand 11 years ago
parent 5facf90cfb
commit 828e72ad02

@ -393,6 +393,13 @@ class NetBiblio extends WebService
return reset($this->AddBookData(BookSearch::GetBooks(array($code)))); return reset($this->AddBookData(BookSearch::GetBooks(array($code))));
} }
/**
* This method returns
* @param int $number
* @param null $seed
* @return array
* @throws WebException
*/
public function GetRandomBooks($number = 100, $seed = null) { public function GetRandomBooks($number = 100, $seed = null) {
if(is_null($seed)) { if(is_null($seed)) {
$seed = time(); $seed = time();
@ -404,6 +411,17 @@ class NetBiblio extends WebService
return $this->AddBookData($results['books']); return $this->AddBookData($results['books']);
} }
/**
* This method is used by the iOS application to perform searching.
* If a number is given, search in the book codes, otherwise perform
* a full text search.
*
* @param string $query Text to search
* @param int $start
* @param int $limit
* @return array
* @throws WebException
*/
public function Search($query, $start, $limit) public function Search($query, $start, $limit)
{ {
$query = array( $query = array(
@ -420,6 +438,16 @@ class NetBiblio extends WebService
return $data; return $data;
} }
/**
* This method is used by the website and the Android application to perform
* book search.
*
* TODO: describe various options for the parameters
*
* @param string $values JSON encoded object
* @return array
* @throws WebException
*/
public function NewSearch($values) public function NewSearch($values)
{ {
$this->CheckSession(); $this->CheckSession();
@ -492,6 +520,11 @@ class NetBiblio extends WebService
return array_merge($data, $this->AddBookData($results['books'])); return array_merge($data, $this->AddBookData($results['books']));
} }
/**
* This method returns the list of all volunteer readers that read book
* in the database.
* @return array
*/
public function ListOfReaders() public function ListOfReaders()
{ {
return AudioBook::listOfReaders(); return AudioBook::listOfReaders();
@ -529,6 +562,12 @@ class NetBiblio extends WebService
}, AudioBook::ListOfGenres(true)); }, AudioBook::ListOfGenres(true));
} }
/**
* This method returns the list of all books that are currently
* being read by the volunteers.
*
* @return array
*/
public function InReadingBooks() public function InReadingBooks()
{ {
return AudioBook::inReading(); return AudioBook::inReading();
@ -539,8 +578,8 @@ class NetBiblio extends WebService
* books for a given Genre. It may receives the genre 'Jeunesse' which * books for a given Genre. It may receives the genre 'Jeunesse' which
* is a boolean value on Solr documents. * is a boolean value on Solr documents.
* *
* @param $genre * @param string $genre Genre for which we want books (not the code)
* @param $number * @param int $number number of books
* @return array * @return array
* @throws WebException * @throws WebException
*/ */

Loading…
Cancel
Save