1 | <?php |
||
16 | class CustomEntityRepository extends ReferenceDataRepository |
||
17 | { |
||
18 | /** |
||
19 | * Create a query builder used for the datagrid |
||
20 | * |
||
21 | * @return QueryBuilder |
||
22 | */ |
||
23 | public function createDatagridQueryBuilder() |
||
29 | |||
30 | /** |
||
31 | * Applies mass action parameters on the query builder |
||
32 | * |
||
33 | * @param QueryBuilder $qb |
||
34 | * @param bool $inset |
||
35 | * @param array $values |
||
36 | */ |
||
37 | public function applyMassActionParameters($qb, $inset, $values) |
||
69 | |||
70 | /** |
||
71 | * Used to mass delete reference datas from their ids |
||
72 | * |
||
73 | * @param int[] $ids |
||
74 | * |
||
75 | * @return int |
||
76 | * @throws \LogicException |
||
77 | */ |
||
78 | public function deleteFromIds(array $ids) |
||
96 | |||
97 | /** |
||
98 | * Hydrates reference data from ids for quick export or mass edit features |
||
99 | * |
||
100 | * @param array $referenceDataIds |
||
101 | * |
||
102 | * @return ArrayCollection |
||
103 | * |
||
104 | * @throws \InvalidArgumentException array of ids should not be empty |
||
105 | */ |
||
106 | public function findByIds(array $referenceDataIds) |
||
122 | |||
123 | /** |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | public function findBySearch($search = null, array $options = []) |
||
132 | |||
133 | /** |
||
134 | * @param string $search |
||
135 | * @param array $options |
||
136 | * |
||
137 | * @return QueryBuilder |
||
138 | */ |
||
139 | protected function findBySearchQB($search, array $options) |
||
159 | |||
160 | /** |
||
161 | * Adds select in the findBySearch method |
||
162 | * Used in products datagrid filtering and product edit form |
||
163 | * This method is used by findBySearch method and it's not recommended to call it from elsewhere |
||
164 | * |
||
165 | * @param QueryBuilder $qb |
||
166 | * @param array $options |
||
167 | */ |
||
168 | protected function selectFields(QueryBuilder $qb, array $options) |
||
190 | |||
191 | /** |
||
192 | * Adds search on label or code in the findBySearch method |
||
193 | * Used in products datagrid filtering and product edit form |
||
194 | * This method is used by findBySearch method and it's not recommended to call it from elsewhere |
||
195 | * |
||
196 | * @param QueryBuilder $qb |
||
197 | * @param string $search |
||
198 | */ |
||
199 | protected function addSearchFilter(QueryBuilder $qb, $search) |
||
209 | |||
210 | /** |
||
211 | * Duplicate code due to method visibility |
||
212 | * |
||
213 | * {@inheritdoc} |
||
214 | */ |
||
215 | protected function getReferenceDataLabelProperty() |
||
221 | |||
222 | /** |
||
223 | * Adds sort order in the findBySearch method |
||
224 | * Used in products datagrid filtering and product edit form |
||
225 | * This method is used by findBySearch method and it's not recommended to call it from elsewhere |
||
226 | * |
||
227 | * @param QueryBuilder $qb |
||
228 | */ |
||
229 | protected function addSortOrder(QueryBuilder $qb) |
||
236 | |||
237 | /** |
||
238 | * @return string |
||
239 | */ |
||
240 | protected function getSortOrderColumn() |
||
246 | } |
||
247 |