1 | <?php |
||
33 | class RelationalRepository extends EntityRepository implements Repository, SpecificationAwareInterface |
||
34 | { |
||
35 | use SpecificationRepositoryTrait; |
||
36 | use RepositoryTrait; |
||
37 | use EventsTrait; |
||
38 | use PaginatorTrait; |
||
39 | |||
40 | /** |
||
41 | * Class alias. |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $classAlias; |
||
46 | |||
47 | /** |
||
48 | * Get class alias. |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | protected function getClassAlias(): string |
||
53 | { |
||
54 | if ($this->classAlias === null) { |
||
55 | $this->classAlias = strtoupper($this->getEntityName()[0]); |
||
56 | } |
||
57 | |||
58 | return $this->classAlias; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function getClassName(): string |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | protected function getManager(): EntityManager |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | * |
||
80 | * @param array|QueryBuilder $criteria |
||
81 | * @param array|null $orderBy |
||
82 | * @param int $itemsPerPage |
||
83 | * |
||
84 | * @throws \InvalidArgumentException |
||
85 | * |
||
86 | * @return \Zend\Paginator\Paginator |
||
87 | */ |
||
88 | public function findPaginatedBy($criteria, array $orderBy = [], int $itemsPerPage = 10): Paginator |
||
103 | |||
104 | /** |
||
105 | * Paginate query. |
||
106 | * |
||
107 | * @param Query $query |
||
108 | * @param int $itemsPerPage |
||
109 | * |
||
110 | * @return Paginator |
||
111 | */ |
||
112 | protected function paginate(Query $query, int $itemsPerPage = 10) : Paginator |
||
116 | |||
117 | /** |
||
118 | * {@inheritdoc} |
||
119 | * |
||
120 | * @param array|QueryBuilder $criteria |
||
121 | * |
||
122 | * @throws \InvalidArgumentException |
||
123 | * |
||
124 | * @return int |
||
125 | */ |
||
126 | public function countBy($criteria): int |
||
138 | |||
139 | /** |
||
140 | * Create query builder based on provided simple criteria. |
||
141 | * |
||
142 | * @param array|QueryBuilder $criteria |
||
143 | * |
||
144 | * @throws \InvalidArgumentException |
||
145 | * |
||
146 | * @return QueryBuilder |
||
147 | */ |
||
148 | protected function createQueryBuilderFromCriteria($criteria): QueryBuilder |
||
178 | } |
||
179 |