| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | protected function removeOlderThan(EntityManager $entityManager, $objectName, $field, \DateTime $olderThan) |
||
| 18 | { |
||
| 19 | $qb = $entityManager->createQueryBuilder()->delete($objectName, 'j'); |
||
| 20 | $qb = $qb |
||
| 21 | ->where('j.'.$field.' < :'.$field) |
||
| 22 | ->setParameter(':'.$field, $olderThan); |
||
| 23 | |||
| 24 | $query = $qb->getQuery(); |
||
| 25 | |||
| 26 | return $query->execute(); |
||
| 27 | } |
||
| 28 | } |
||
| 29 |