Loading src/Entity/HasCalendriersInterface.php +1 −1 Original line number Diff line number Diff line Loading @@ -10,5 +10,5 @@ interface HasCalendriersInterface { public function addCalendrier(Calendrier $calendrier): void; public function removeCalendrier(Calendrier $calendrier): void; public function hasCalendrier(?Calendrier $calendrier): bool; public function getCalendrierByTypeCode(string $code): ?Calendrier; } No newline at end of file src/Entity/HasCalendriersTrait.php +9 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,13 @@ trait HasCalendriersTrait { { return $this->calendriers->contains($calendrier); } public function getCalendrierByTypeCode(string $code): ?Calendrier { /** @var Calendrier $calendrier */ foreach ($this->calendriers as $calendrier) { if ($calendrier->estNonHistorise() && $calendrier->getCalendrierType()->getCode() === $code) return $calendrier; } return null; } } No newline at end of file Loading
src/Entity/HasCalendriersInterface.php +1 −1 Original line number Diff line number Diff line Loading @@ -10,5 +10,5 @@ interface HasCalendriersInterface { public function addCalendrier(Calendrier $calendrier): void; public function removeCalendrier(Calendrier $calendrier): void; public function hasCalendrier(?Calendrier $calendrier): bool; public function getCalendrierByTypeCode(string $code): ?Calendrier; } No newline at end of file
src/Entity/HasCalendriersTrait.php +9 −0 Original line number Diff line number Diff line Loading @@ -29,4 +29,13 @@ trait HasCalendriersTrait { { return $this->calendriers->contains($calendrier); } public function getCalendrierByTypeCode(string $code): ?Calendrier { /** @var Calendrier $calendrier */ foreach ($this->calendriers as $calendrier) { if ($calendrier->estNonHistorise() && $calendrier->getCalendrierType()->getCode() === $code) return $calendrier; } return null; } } No newline at end of file