Adding manager that returns Doctrine style repositories

This commit is contained in:
Richard Miller 2011-11-12 21:10:00 +00:00
commit 7dbc4221ae
7 changed files with 218 additions and 0 deletions

31
Repository.php Normal file
View file

@ -0,0 +1,31 @@
<?php
namespace FOQ\ElasticaBundle;
/**
* @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;
}
public function find($query)
{
return $this->finder->find($query);
}
public function findPaginated($query)
{
return $this->finder->findPaginated($query);
}
}