File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,6 +180,17 @@ public function hasLocale(LocaleInterface $locale): bool
180180 return $ this ->locales ->contains ($ locale );
181181 }
182182
183+ public function hasLocaleWithLocaleCode (string $ localeCode ): bool
184+ {
185+ return !$ this
186+ ->locales
187+ ->filter (function (LocaleInterface $ locale ) use ($ localeCode ): bool {
188+ return $ locale ->getCode () === $ localeCode ;
189+ })
190+ ->isEmpty ()
191+ ;
192+ }
193+
183194 public function getCountries (): Collection
184195 {
185196 return $ this ->countries ;
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ public function getLocales(): Collection;
2626
2727 public function hasLocale (LocaleInterface $ locale ): bool ;
2828
29+ public function hasLocaleWithLocaleCode (string $ localeCode ): bool ;
30+
2931 public function addLocale (LocaleInterface $ locale ): void ;
3032
3133 public function removeLocale (LocaleInterface $ locale ): void ;
You can’t perform that action at this time.
0 commit comments