@@ 262-278 (lines=17) @@ | ||
259 | * @param \DateTime|null $start |
|
260 | * @param \DateTime|null $end |
|
261 | */ |
|
262 | protected function applyDateFiltering( |
|
263 | QueryBuilder $qb, |
|
264 | $field, |
|
265 | \DateTime $start = null, |
|
266 | \DateTime $end = null |
|
267 | ) { |
|
268 | if ($start) { |
|
269 | $qb |
|
270 | ->andWhere(sprintf('%s >= :start', $field)) |
|
271 | ->setParameter('start', $start); |
|
272 | } |
|
273 | if ($end) { |
|
274 | $qb |
|
275 | ->andWhere(sprintf('%s <= :end', $field)) |
|
276 | ->setParameter('end', $end); |
|
277 | } |
|
278 | } |
|
279 | ||
280 | /** |
|
281 | * @return OpportunityRepository |
@@ 291-307 (lines=17) @@ | ||
288 | * @param \DateTime|null $start |
|
289 | * @param \DateTime|null $end |
|
290 | */ |
|
291 | protected function applyDateFiltering( |
|
292 | QueryBuilder $qb, |
|
293 | $field, |
|
294 | \DateTime $start = null, |
|
295 | \DateTime $end = null |
|
296 | ) { |
|
297 | if ($start) { |
|
298 | $qb |
|
299 | ->andWhere(sprintf('%s >= :start', $field)) |
|
300 | ->setParameter('start', $start); |
|
301 | } |
|
302 | if ($end) { |
|
303 | $qb |
|
304 | ->andWhere(sprintf('%s <= :end', $field)) |
|
305 | ->setParameter('end', $end); |
|
306 | } |
|
307 | } |
|
308 | } |
|
309 |