Adding manager that returns Doctrine style repositories
This commit is contained in:
parent
eb1900265f
commit
7dbc4221ae
7 changed files with 218 additions and 0 deletions
31
Repository.php
Normal file
31
Repository.php
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue