2011-11-12 22:10:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FOQ\ElasticaBundle;
|
|
|
|
|
2012-07-10 21:41:27 +02:00
|
|
|
use FOQ\ElasticaBundle\Finder\PaginatedFinderInterface;
|
|
|
|
|
2011-11-12 22:10:00 +01:00
|
|
|
/**
|
|
|
|
* @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;
|
|
|
|
|
2012-07-10 21:41:27 +02:00
|
|
|
public function __construct(PaginatedFinderInterface $finder)
|
2011-11-12 22:10:00 +01:00
|
|
|
{
|
|
|
|
$this->finder = $finder;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function find($query)
|
|
|
|
{
|
|
|
|
return $this->finder->find($query);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function findPaginated($query)
|
|
|
|
{
|
|
|
|
return $this->finder->findPaginated($query);
|
|
|
|
}
|
|
|
|
|
2012-07-10 21:30:19 +02:00
|
|
|
public function findHybrid($query)
|
|
|
|
{
|
|
|
|
return $this->finder->findHybrid($query);
|
|
|
|
}
|
|
|
|
|
2012-07-10 18:16:44 +02:00
|
|
|
public function createPaginatorAdapter($query)
|
|
|
|
{
|
|
|
|
return $this->finder->createPaginatorAdapter($query);
|
|
|
|
}
|
2011-11-12 22:10:00 +01:00
|
|
|
}
|