SiteSettingRepositoryInterface
in
Interface SiteSetting.
Tags
Table of Contents
Methods
- bootingKernelConfigs() : void
- Update laravel config() when booting.
- createSetting() : bool
- destroy() : bool
- Remove settings from core_site_settings by `module_id` and `name`.
- get() : mixed|null
- Get user actual value for specific setting key.
- getPrivateEnvironments() : array<string|int, mixed>
- getSiteSettings() : array<string, array<string, mixed>>
- has() : bool
- Check a settings is exists.
- keys() : array<string|int, mixed>
- This method is used to generate ide:fix.
- loadConfigValues() : array<string|int, mixed>
- refresh() : void
- This method should be call when you want to refresh cached data after saving new values.
- reset() : bool
- Reset core_site_settings to value_default by specific $module and name list.
- save() : array<string, mixed>
- Save user actual values, only existed name in database can be update.
- saveAndCollectPrivateSettings() : array<string, mixed>
- Save setting values and collect all private settings by $privateSettings reference.
- setupPackageSettings() : array<string, mixed>
- Create/Update core_site_setting by `name`, and `value_default`.
- updatedAt() : string
- Last updated time. this is alias to `get('core.setting_updated_at')`.
- updateSetting() : bool
- versionId() : int
- Whenever admin updated revision, we must increment versionId This value is used to publish cache and purge caching data cross multiple distribute server.
Methods
bootingKernelConfigs()
Update laravel config() when booting.
public
bootingKernelConfigs() : void
createSetting()
public
createSetting(string $module, string $name, string|null $configName, string|null $envVar, mixed $value, string $type, bool $public, bool $auto) : bool
Parameters
- $module : string
- $name : string
- $configName : string|null
- $envVar : string|null
- $value : mixed
- $type : string
- $public : bool
- $auto : bool
Return values
booldestroy()
Remove settings from core_site_settings by `module_id` and `name`.
public
destroy(string $module[, array<string|int, mixed>|null $names = null ]) : bool
If names
is null, remove all by module_id
.
Parameters
- $module : string
- $names : array<string|int, mixed>|null = null
Tags
Return values
boolget()
Get user actual value for specific setting key.
public
get(string $key[, mixed $default = null ]) : mixed|null
If value_actual is not exists, it use alternate value_default.
Note: not all data should be saved in to cached because of data size etc: you should not keep 10Kb text string into setting cache because it push to memory at application start time.
Parameters
- $key : string
- $default : mixed = null
Tags
Return values
mixed|nullgetPrivateEnvironments()
public
getPrivateEnvironments() : array<string|int, mixed>
Return values
array<string|int, mixed>getSiteSettings()
public
getSiteSettings(string $for, bool $loadFromDriver) : array<string, array<string, mixed>>
Parameters
- $for : string
-
web, mobile, admin
- $loadFromDriver : bool
Return values
array<string, array<string, mixed>>has()
Check a settings is exists.
public
has(string $key) : bool
Parameters
- $key : string
Tags
Return values
boolkeys()
This method is used to generate ide:fix.
public
keys() : array<string|int, mixed>
Return values
array<string|int, mixed>loadConfigValues()
public
loadConfigValues() : array<string|int, mixed>
Return values
array<string|int, mixed>refresh()
This method should be call when you want to refresh cached data after saving new values.
public
refresh() : void
By default values is loaded from cached. when refresh call it will reload data from database then pull up to cache.
Tags
reset()
Reset core_site_settings to value_default by specific $module and name list.
public
reset(string $module[, array<string|int, mixed>|null $names = null ]) : bool
if $names is null, it will reset all values for specific module.
Parameters
- $module : string
- $names : array<string|int, mixed>|null = null
Tags
Return values
boolsave()
Save user actual values, only existed name in database can be update.
public
save(array<string, mixed> $values) : array<string, mixed>
It should not create new row.
Parameters
- $values : array<string, mixed>
Tags
Return values
array<string, mixed>saveAndCollectPrivateSettings()
Save setting values and collect all private settings by $privateSettings reference.
public
saveAndCollectPrivateSettings(array<string, mixed> $values[, array<string, mixed>|null &$privateSettings = [] ]) : array<string, mixed>
Parameters
- $values : array<string, mixed>
- $privateSettings : array<string, mixed>|null = []
Return values
array<string, mixed>setupPackageSettings()
Create/Update core_site_setting by `name`, and `value_default`.
public
setupPackageSettings(string $module, array<string, mixed> $settings) : array<string, mixed>
Parameters
- $module : string
- $settings : array<string, mixed>
Tags
Return values
array<string, mixed>updatedAt()
Last updated time. this is alias to `get('core.setting_updated_at')`.
public
updatedAt() : string
Tags
Return values
stringupdateSetting()
public
updateSetting(string $module, string $name, string|null $configName, string|null $envVar, mixed $value, string $type, bool|null $public, bool|null $auto) : bool
Parameters
- $module : string
- $name : string
- $configName : string|null
- $envVar : string|null
- $value : mixed
- $type : string
- $public : bool|null
- $auto : bool|null
Return values
boolversionId()
Whenever admin updated revision, we must increment versionId This value is used to publish cache and purge caching data cross multiple distribute server.
public
versionId() : int
This is alias of $this->get('core.setting_version_id');