| Total Complexity | 6 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class InfotextRepository extends AbstractTransactionalRepository implements InfotextRepositoryInterface { |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @inheritDoc |
||
| 13 | */ |
||
| 14 | public function findAll(): array { |
||
| 15 | return $this->em |
||
| 16 | ->getRepository(Infotext::class) |
||
| 17 | ->findAll(); |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @inheritDoc |
||
| 22 | */ |
||
| 23 | public function findAllByDate(DateTime $dateTime): array { |
||
| 24 | return $this->em |
||
| 25 | ->getRepository(Infotext::class) |
||
| 26 | ->findBy([ |
||
| 27 | 'date' => $dateTime |
||
| 28 | ]); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @inheritDoc |
||
| 33 | */ |
||
| 34 | public function persist(Infotext $infotext): void { |
||
| 37 | } |
||
| 38 | |||
| 39 | public function removeAll(?DateTime $dateTime = null): void { |
||
| 40 | $qb = $this->em->createQueryBuilder() |
||
| 41 | ->delete(Infotext::class, 'i'); |
||
| 42 | |||
| 43 | if($dateTime !== null) { |
||
| 44 | $qb->where('i.date = :date') |
||
| 45 | ->setParameter('date', $dateTime); |
||
| 46 | } |
||
| 47 | |||
| 48 | $qb->getQuery() |
||
| 49 | ->execute(); |
||
| 50 | |||
| 51 | $this->flushIfNotInTransaction(); |
||
| 52 | } |
||
| 53 | |||
| 54 | public function removeBetween(DateTime $start, DateTime $end): int { |
||
| 63 | } |
||
| 64 | } |