Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| WeeklyPictureRepository | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| getLatestThree | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Olz\Repository\Startseite; |
| 4 | |
| 5 | use Olz\Entity\Startseite\WeeklyPicture; |
| 6 | use Olz\Repository\Common\OlzRepository; |
| 7 | |
| 8 | /** |
| 9 | * @extends OlzRepository<WeeklyPicture> |
| 10 | */ |
| 11 | class WeeklyPictureRepository extends OlzRepository { |
| 12 | protected string $entityClass = WeeklyPicture::class; |
| 13 | |
| 14 | /** @return array<WeeklyPicture> */ |
| 15 | public function getLatestThree(): array { |
| 16 | $dql = " |
| 17 | SELECT wp |
| 18 | FROM {$this->entityClass} wp |
| 19 | WHERE wp.on_off = 1 |
| 20 | ORDER BY wp.datum DESC |
| 21 | "; |
| 22 | $query = $this->getEntityManager()->createQuery($dql)->setMaxResults(3); |
| 23 | return $query->getResult(); |
| 24 | } |
| 25 | } |