FOSElasticaBundle/Repository.php
Schyzophrenic 3b391919c9 Fix resultSet size when using a Repository
When using a Repository, the $limit parameter was lost along the way.
This is why the limit was always set to 10 in that case.
2012-08-05 02:43:52 +03:00

43 lines
848 B
PHP

<?php
namespace FOQ\ElasticaBundle;
use FOQ\ElasticaBundle\Finder\PaginatedFinderInterface;
/**
* @author Richard Miller <info@limethinking.co.uk>
*
* Basic respoitory to be extended to hold custom queries to be run
* in the finder.
*/
class Repository
{
protected $finder;
public function __construct(PaginatedFinderInterface $finder)
{
$this->finder = $finder;
}
public function find($query, $limit=null)
{
return $this->finder->find($query, $limit);
}
public function findPaginated($query)
{
return $this->finder->findPaginated($query);
}
public function findHybrid($query)
{
return $this->finder->findHybrid($query);
}
public function createPaginatorAdapter($query)
{
return $this->finder->createPaginatorAdapter($query);
}
}