add localeKeyExists method #14

This commit is contained in:
ghost 2023-09-26 04:07:01 +03:00
parent d955446b99
commit fe48055f82

View File

@ -19,6 +19,19 @@ class AppModelLocale {
public function getLocales() : object public function getLocales() : object
{ {
return $this->_locales; return (object) $this->_locales;
}
public function localeKeyExists(string $key) : bool
{
foreach ($this->_locales as $locale)
{
if ($locale->key === $key)
{
return true;
}
}
return false;
} }
} }