PHP Class app\models\Setting

Inheritance: extends yii\db\ActiveRecord
显示文件 Open project: phanan/koel Class Usage Examples

Public Properties

Property Type Description
$timestamps

Protected Properties

Property Type Description
$guarded
$primaryKey

Public Methods

Method Description
get ( string $key ) : mixed Get a setting value.
getValueAttribute ( $value )
set ( string | array $key, mixed $value = null ) Set a setting (no pun) value.
setValueAttribute ( mixed $value ) Serialize the setting value before saving into the database.

Method Details

get() public static method

Get a setting value.
public static get ( string $key ) : mixed
$key string
return mixed

getValueAttribute() public method

public getValueAttribute ( $value )

set() public static method

Set a setting (no pun) value.
public static set ( string | array $key, mixed $value = null )
$key string | array The key of the setting, or an associative array of settings, in which case $value will be discarded.
$value mixed

setValueAttribute() public method

This makes settings more flexible.
public setValueAttribute ( mixed $value )
$value mixed

Property Details

$guarded protected_oe property

protected $guarded

$primaryKey protected_oe property

protected $primaryKey

$timestamps public_oe property

public $timestamps