| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2.004 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 2 | protected function removeOlderThan($objectName, $field, \DateTime $olderThan) |
|
| 21 | { |
||
| 22 | /** @var DocumentManager $objectManager */ |
||
| 23 | 2 | $objectManager = $this->getObjectManager(); |
|
| 24 | 2 | $qb = $objectManager->createQueryBuilder($objectName); |
|
| 25 | $qb |
||
| 26 | 2 | ->remove() |
|
| 27 | 2 | ->field($field)->lt($olderThan); |
|
| 28 | |||
| 29 | 2 | $query = $qb->getQuery(); |
|
| 30 | 2 | $result = $query->execute(); |
|
| 31 | 2 | if (isset($result['n'])) { |
|
| 32 | 2 | return $result['n']; |
|
| 33 | } |
||
| 34 | |||
| 35 | return 0; |
||
| 36 | } |
||
| 67 |