PHP Class app\models\Setting

Inheritance: extends yii\db\ActiveRecord
Show file 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 property

protected $guarded

$primaryKey protected property

protected $primaryKey

$timestamps public property

public $timestamps