mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
37 lines
592 B
PHP
37 lines
592 B
PHP
<?php
|
|
|
|
class AppModelLocale {
|
|
|
|
private $_locales = [];
|
|
|
|
public function __construct(object $locales)
|
|
{
|
|
foreach ($locales as $code => $value)
|
|
{
|
|
$this->_locales[] = (object)
|
|
[
|
|
'code' => $code,
|
|
'value' => $value[0],
|
|
'active' => false,
|
|
];
|
|
}
|
|
}
|
|
|
|
public function getList() : object
|
|
{
|
|
return (object) $this->_locales;
|
|
}
|
|
|
|
public function codeExists(string $code) : bool
|
|
{
|
|
foreach ($this->_locales as $locale)
|
|
{
|
|
if ($locale->code === $code)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|