class GetSettings
{
private array $newsSettings = [1, 22, 25];
public function get($settingName)
{
if (property_exists($this, $settingName)) {
return $this->{$settingName};
} else {
return false;
}
}
public function getAll()
{
return get_object_vars($this);
}
}
$CSettings = new GetSettings;
$setting = $CSettings->get('newsSettings');
или так
$CSettings = new GetSettings;
$arSettings = $CSettings->getAll();