Make TransformedFinder::find limit argument optional - fixes #8
This commit is contained in:
parent
59313e0ba7
commit
83b177e4f2
|
@ -27,12 +27,16 @@ class TransformedFinder implements FinderInterface, PaginatedFinderInterface
|
|||
/**
|
||||
* Search for a query string
|
||||
*
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
* @return array of model objects
|
||||
**/
|
||||
public function find($query, $limit)
|
||||
public function find($query, $limit = null)
|
||||
{
|
||||
$queryObject = Elastica_Query::create($query);
|
||||
$queryObject->setLimit($limit);
|
||||
if (null !== $limit) {
|
||||
$queryObject->setLimit($limit);
|
||||
}
|
||||
$results = $this->searchable->search($queryObject)->getResults();
|
||||
|
||||
return $this->transformer->transform($results);
|
||||
|
|
Loading…
Reference in a new issue