File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ class MongoDBAdapter extends AbstractAdapter
3434
3535 /** @var Collection */
3636 private $ collection ;
37+ /** @var array */
38+ private $ filters ;
3739
3840 /**
3941 * {@inheritdoc}
@@ -45,6 +47,7 @@ public function configure(array $options)
4547 $ options = $ resolver ->resolve ($ options );
4648
4749 $ this ->collection = $ options ['collection ' ];
50+ $ this ->filters = $ options ['filters ' ];
4851 }
4952
5053 /**
@@ -76,7 +79,7 @@ protected function getResults(AdapterQuery $query): \Traversable
7679 {
7780 $ state = $ query ->getState ();
7881
79- $ filter = [] ;
82+ $ filter = $ this -> filters ;
8083 $ options = [
8184 'limit ' => $ state ->getLength (),
8285 'skip ' => $ state ->getStart (),
@@ -122,9 +125,11 @@ protected function configureOptions(OptionsResolver $resolver)
122125 {
123126 $ resolver
124127 ->setDefaults ([
128+ 'filters ' => [],
125129 ])
126130 ->setRequired (['collection ' ])
127131 ->setAllowedTypes ('collection ' , \MongoDB \Collection::class)
132+ ->setAllowedTypes ('filters ' , 'array ' )
128133 ;
129134 }
130135}
You can’t perform that action at this time.
0 commit comments