Conditions | 4 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function get(UuidInterface $bookId) |
||
24 | { |
||
25 | $views = []; |
||
26 | |||
27 | /** @var Reservation $reservation */ |
||
28 | foreach ($this->repository->getAll() as $reservation) { |
||
29 | if (!$reservation->bookId()->equals($bookId)) { |
||
30 | continue; |
||
31 | } |
||
32 | |||
33 | $views[] = new ReservationView( |
||
34 | (string) $reservation->id(), |
||
35 | $reservation->email(), |
||
36 | ($reservation->isGivenAway()) ? $reservation->givenAwayAt()->format('Y-m-d H:i:s') : null |
||
37 | ); |
||
38 | } |
||
39 | |||
40 | return $views; |
||
41 | } |
||
42 | } |
||
43 |