2011-11-12 22:10:00 +01:00
|
|
|
<?php
|
|
|
|
|
2013-03-27 18:39:28 +01:00
|
|
|
namespace FOS\ElasticaBundle;
|
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;
|
|
|
|
|
|
|
|
public function __construct($finder)
|
|
|
|
{
|
|
|
|
$this->finder = $finder;
|
|
|
|
}
|
|
|
|
|
2012-08-05 01:35:32 +02:00
|
|
|
public function find($query, $limit=null)
|
2011-11-12 22:10:00 +01:00
|
|
|
{
|
2012-08-05 01:35:32 +02:00
|
|
|
return $this->finder->find($query, $limit);
|
2011-11-12 22:10:00 +01:00
|
|
|
}
|
|
|
|
|
2012-08-07 20:25:43 +02:00
|
|
|
public function findHybrid($query, $limit=null)
|
|
|
|
{
|
|
|
|
return $this->finder->findHybrid($query, $limit);
|
|
|
|
}
|
|
|
|
|
2011-11-12 22:10:00 +01:00
|
|
|
public function findPaginated($query)
|
|
|
|
{
|
|
|
|
return $this->finder->findPaginated($query);
|
|
|
|
}
|
|
|
|
}
|