class OverrideSettingsRepository implements SettingsRepositoryInterface

A settings repository decorator that allows overriding certain values.

The OverrideSettingsRepository class decorates another SettingsRepositoryInterface instance but allows certain settings to be overridden with predefined values. It does not affect writing methods.

Within Flarum, this can be used to test out new setting values in a system before they are committed to the database.

Methods

__construct(SettingsRepositoryInterface $inner, array $overrides)

No description

array
all()

No description

mixed
get(string $key, mixed $default = null)

<p>You generally should use the Settings extender's <code>default</code> method instead to register default values.</p>

void
set(string $key, mixed $value)

No description

void
delete(string $keyLike)

No description

Details

__construct(SettingsRepositoryInterface $inner, array $overrides)

Parameters

SettingsRepositoryInterface $inner
array $overrides

array all()

Return Value

array

mixed get(string $key, mixed $default = null)

<p>You generally should use the Settings extender's <code>default</code> method instead to register default values.</p>

<p>You may still need to use the <code>$default</code> parameters here in cases where you need to access the default value of a dynamic setting.</p>

Parameters

string $key
mixed $default

Return Value

mixed

void set(string $key, mixed $value)

Parameters

string $key
mixed $value

Return Value

void

void delete(string $keyLike)

Parameters

string $keyLike

Return Value

void