| @@ 293-309 (lines=17) @@ | ||
| 290 | * @param \DateTime|null $start |
|
| 291 | * @param \DateTime|null $end |
|
| 292 | */ |
|
| 293 | protected function applyDateFiltering( |
|
| 294 | QueryBuilder $qb, |
|
| 295 | $field, |
|
| 296 | \DateTime $start = null, |
|
| 297 | \DateTime $end = null |
|
| 298 | ) { |
|
| 299 | if ($start) { |
|
| 300 | $qb |
|
| 301 | ->andWhere(sprintf('%s >= :start', $field)) |
|
| 302 | ->setParameter('start', $start); |
|
| 303 | } |
|
| 304 | if ($end) { |
|
| 305 | $qb |
|
| 306 | ->andWhere(sprintf('%s < :end', $field)) |
|
| 307 | ->setParameter('end', $end); |
|
| 308 | } |
|
| 309 | } |
|
| 310 | } |
|
| 311 | ||
| @@ 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 |
|