$key) ? self::$settings->$key : $default; } /** * Get all settings * * @return array */ public static function all() { self::init(); return self::$settings; } /** * Initialize settings array */ private static function init() { if (!self::$initialized) { $model = new SettingsModel(); self::$settings = $model->getAll(); } } }