1 | <?php |
||
29 | class CouchDBRepository extends DocumentRepository implements Repository |
||
30 | { |
||
31 | use RepositoryTrait { |
||
32 | refresh as baseRefresh; |
||
33 | } |
||
34 | use EventsTrait; |
||
35 | use FiltersTrait; |
||
36 | use PaginatorTrait; |
||
37 | |||
38 | /** |
||
39 | * Class name. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $className; |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function getClassName(): string |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | * |
||
60 | * @throws \LogicException |
||
61 | */ |
||
62 | protected function getFilterCollection() |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | protected function getManager(): DocumentManager |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | * |
||
78 | * @param array $criteria |
||
79 | * @param array|null $orderBy |
||
80 | * @param int $itemsPerPage |
||
81 | * |
||
82 | * @return \Zend\Paginator\Paginator |
||
83 | */ |
||
84 | public function findPaginatedBy($criteria, array $orderBy = null, int $itemsPerPage = 10): Paginator |
||
92 | |||
93 | /** |
||
94 | * Paginate CouchDB results. |
||
95 | * |
||
96 | * @param array $results |
||
97 | * @param int $itemsPerPage |
||
98 | * |
||
99 | * @return Paginator |
||
100 | */ |
||
101 | protected function paginate(array $results, int $itemsPerPage = 10): Paginator |
||
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | * |
||
109 | * @param array $criteria |
||
110 | * |
||
111 | * @return int |
||
112 | */ |
||
113 | public function countBy($criteria): int |
||
117 | |||
118 | /** |
||
119 | * Flush managed object. |
||
120 | * |
||
121 | * @param object|object[]|\Traversable $objects |
||
122 | * @param bool $flush |
||
123 | * |
||
124 | * @SuppressWarnings(PMD.UnusedFormalParameter) |
||
125 | */ |
||
126 | protected function flushObjects($objects, bool $flush) |
||
132 | } |
||
133 |