1 | <?php |
||
27 | class DocumentDataSource extends DataSource |
||
28 | { |
||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $documentName; |
||
33 | |||
34 | /** |
||
35 | * @var DocumentManager |
||
36 | */ |
||
37 | protected $dm; |
||
38 | |||
39 | /** |
||
40 | * @var SpecificationVisitorFactoryInterface |
||
41 | */ |
||
42 | protected $specificationVisitorFactory; |
||
43 | |||
44 | /** |
||
45 | * @var ComparatorVisitorFactoryInterface |
||
46 | */ |
||
47 | protected $comparatorVisitorFactory; |
||
48 | |||
49 | /** |
||
50 | * @var QueryBuilder |
||
51 | */ |
||
52 | private $queryBuilder; |
||
53 | |||
54 | /** |
||
55 | * @param DocumentManager $dm |
||
56 | * @param SpecificationVisitorFactoryInterface $specificationVisitorFactory |
||
57 | * @param ComparatorVisitorFactoryInterface $comparatorVisitorFactory |
||
58 | * @param string $documentName |
||
59 | * @param SpecificationInterface $searchCriteria |
||
60 | * @param ComparatorInterface $sortCriteria |
||
61 | * @param string $offset |
||
62 | * @param string $length |
||
63 | */ |
||
64 | public function __construct( |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | public function getIterator() |
||
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | public function findOne() |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function filteredDataSource(SpecificationInterface $criteria) |
||
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | public function slicedDataSource($offset, $length = null) |
||
127 | |||
128 | /** |
||
129 | * {@inheritdoc} |
||
130 | */ |
||
131 | public function sortedDataSource(ComparatorInterface $sortCriteria) |
||
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | protected function calculateCount() |
||
148 | |||
149 | /** |
||
150 | * @return \Cubiche\Infrastructure\Repository\Doctrine\ODM\MongoDB\QueryBuilder |
||
151 | */ |
||
152 | protected function queryBuilder() |
||
177 | |||
178 | /** |
||
179 | * @param SpecificationInterface $searchCriteria |
||
180 | * @param ComparatorInterface $sortCriteria |
||
181 | * @param string $offset |
||
182 | * @param string $length |
||
183 | * |
||
184 | * @return DocumentDataSource |
||
185 | */ |
||
186 | protected function createDocumentDataSource( |
||
203 | } |
||
204 |