1 | <?php |
||
30 | class MongoDBRepository extends DocumentRepository implements Repository |
||
31 | { |
||
32 | use RepositoryTrait; |
||
33 | use EventsTrait; |
||
34 | use FiltersTrait; |
||
35 | use PaginatorTrait; |
||
36 | |||
37 | /** |
||
38 | * Class name. |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $className; |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function getClassName(): string |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | protected function getFilterCollection() |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | protected function getManager(): DocumentManager |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | * |
||
75 | * @param array $criteria |
||
76 | * @param array|null $orderBy |
||
77 | * @param int $itemsPerPage |
||
78 | * |
||
79 | * @return \Zend\Paginator\Paginator |
||
80 | */ |
||
81 | public function findPaginatedBy($criteria, array $orderBy = null, int $itemsPerPage = 10): Paginator |
||
85 | |||
86 | /** |
||
87 | * Paginate MongoDB cursor. |
||
88 | * |
||
89 | * @param Cursor $cursor |
||
90 | * @param int $itemsPerPage |
||
91 | * |
||
92 | * @return Paginator |
||
93 | */ |
||
94 | protected function paginate(Cursor $cursor, int $itemsPerPage = 10): Paginator |
||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | * |
||
102 | * @param array $criteria |
||
103 | * |
||
104 | * @return int |
||
105 | */ |
||
106 | public function countBy($criteria): int |
||
110 | } |
||
111 |