SchulIT /
icc
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App\Grouping; |
||
| 4 | |||
| 5 | use DateTime; |
||
| 6 | use App\Entity\Exam; |
||
| 7 | |||
| 8 | class ExamDateGroup implements GroupInterface, SortableGroupInterface { |
||
| 9 | /** |
||
| 10 | * @var Exam[] |
||
| 11 | */ |
||
| 12 | private ?array $exams = null; |
||
| 13 | |||
| 14 | public function __construct(private DateTime $date) |
||
| 15 | { |
||
| 16 | } |
||
| 17 | |||
| 18 | public function getDate(): DateTime { |
||
| 19 | return $this->date; |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @return Exam[] |
||
| 24 | */ |
||
| 25 | public function getExams() { |
||
| 26 | return $this->exams; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return DateTime |
||
| 31 | */ |
||
| 32 | public function getKey() { |
||
| 33 | return $this->date; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param Exam $item |
||
| 38 | */ |
||
| 39 | public function addItem($item) { |
||
| 40 | $this->exams[] = $item; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return Exam[] |
||
| 45 | */ |
||
| 46 | public function &getItems(): array { |
||
| 47 | return $this->exams; |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 48 | } |
||
| 49 | } |