Abstract Class humhub\libs\BaseSettingsManager

Inheritancehumhub\libs\BaseSettingsManager » yii\base\Component
Subclasseshumhub\components\SettingsManager, humhub\modules\content\components\ContentContainerSettingsManager
Available since version1.1

Description of SettingManager

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$modelClass string Settings model class name humhub\libs\BaseSettingsManager
$moduleId string Module id this settings manager belongs to. humhub\libs\BaseSettingsManager

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$_loaded array|null Of loaded settings humhub\libs\BaseSettingsManager

Public Methods

Hide inherited methods

MethodDescriptionDefined By
delete() Deletes setting humhub\libs\BaseSettingsManager
deleteAll() Deletes all stored settings humhub\libs\BaseSettingsManager
get() Returns value of setting humhub\libs\BaseSettingsManager
getSerialized() Receives a value which was saved as serialized value. humhub\libs\BaseSettingsManager
getUncached() Returns the value of setting without any caching humhub\libs\BaseSettingsManager
init() humhub\libs\BaseSettingsManager
isDatabaseInstalled() Checks if settings table exists or application is not installed yet humhub\libs\BaseSettingsManager
reload() Reloads all values from database humhub\libs\BaseSettingsManager
set() Sets a settings value humhub\libs\BaseSettingsManager
setSerialized() Can be used to set object/arrays as a serialized values. humhub\libs\BaseSettingsManager

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
createRecord() Returns settings active record instance humhub\libs\BaseSettingsManager
find() Returns ActiveQuery to find settings humhub\libs\BaseSettingsManager
getCacheKey() Returns settings managers cache key humhub\libs\BaseSettingsManager
invalidateCache() Invalidates settings cache humhub\libs\BaseSettingsManager
loadValues() Loads values from database humhub\libs\BaseSettingsManager

Property Details

$_loaded protected property

Of loaded settings

protected array|null $_loaded null
$modelClass public property

Settings model class name

public string $modelClass 'humhub\models\Setting'
$moduleId public property

Module id this settings manager belongs to.

public string $moduleId null

Method Details

createRecord() protected method

Returns settings active record instance

protected void createRecord ( )
delete() public method

Deletes setting

public void delete ( $name )
$name string
throws Throwable
throws \yii\db\StaleObjectException
deleteAll() public method

Deletes all stored settings

public void deleteAll ( $prefix null )
$prefix string|null

If set only delete settings with given name prefix (e.g. theme.)

find() protected method

Returns ActiveQuery to find settings

protected \yii\db\ActiveQuery find ( )
get() public method

Returns value of setting

public string get ( $name, $default null )
$name string

The name of setting

$default
return string

The setting value or null when not exists

getCacheKey() protected method

Returns settings managers cache key

protected string getCacheKey ( )
return string

The cache key

getSerialized() public method

Receives a value which was saved as serialized value.

public void getSerialized ( $name, $default null )
$name string
$default mixed

The setting value or null when not exists

getUncached() public method

Returns the value of setting without any caching

public string getUncached ( $name, $default null )
$name string

The name of setting

$default
return string

The setting value or null when not exists

init() public method

public void init ( )
invalidateCache() protected method

Invalidates settings cache

protected void invalidateCache ( )
isDatabaseInstalled() public static method (available since version 1.3)

Checks if settings table exists or application is not installed yet

public static boolean isDatabaseInstalled ( )
loadValues() protected method

Loads values from database

protected void loadValues ( )
reload() public method

Reloads all values from database

public void reload ( )
set() public method

Sets a settings value

public void set ( $name, $value )
$name string
$value string
setSerialized() public method

Can be used to set object/arrays as a serialized values.

public void setSerialized ( $name, $value )
$name string
$value mixed

Array or object