forked from FriendsOfSymfony/FOSElasticaBundle
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Repository.php
41 lines (33 loc) · 868 Bytes
/
Repository.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace FOQ\ElasticaBundle;
use FOQ\ElasticaBundle\Finder\PaginatedFinderInterface;
/**
* @author Richard Miller <[email protected]>
*
* 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 findHybrid($query, $limit=null)
{
return $this->finder->findHybrid($query, $limit);
}
public function findPaginated($query)
{
return $this->finder->findPaginated($query);
}
public function createPaginatorAdapter($query)
{
return $this->finder->createPaginatorAdapter($query);
}
}