Skip to content

Internals Setting Config

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

setting\Config

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/setting/Config.php · Snapshot 8411f4287706.

Database-backed settings are initialized as named SettingModel constants and retrieved through Config.

Imports and dependencies

use setting\model\SettingModel;

Config

Declaration and architectural role

final class Config

Constants, enum cases, traits and properties

Declarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.

Member Declaration Purpose or source contract
$settingModel static private SettingModel $settingModel; Used by getConfig().

Method index

Method Signature
getConfig public static function getConfig($package_name, $setting_name): ?SettingModel

getConfig

Source line 11

public static function getConfig($package_name, $setting_name): ?SettingModel

Parameters

Parameter Type, modifiers and default Purpose
$package_name $package_name Operation input; the exact use, validation and propagation are shown in the implementation trace.
$setting_name $setting_name Operation input; the exact use, validation and propagation are shown in the implementation trace.

State writes: static::$settingModel.

Return expressions (including local callbacks): null; static::$settingModel.

Implementation, validation guards and interaction order
public static function getConfig($package_name, $setting_name): ?SettingModel
    {
        $name = "SETT_" .
            strtoupper(
                str_replace('-', '_', str_replace(' ', '_', $package_name))
                . "_" .
                str_replace('-', '_', str_replace(' ', '_', $setting_name))
            );

        if (defined($name)) {
            static::$settingModel = constant($name);
        } else {
            return null;
        }
        return static::$settingModel;
    }

Related types

Clone this wiki locally