PHP Class App\Services\Setting\Setting

Author: forehalo ([email protected])
Show file Open project: forehalo/materialize-blog

Protected Properties

Property Type Description
$changed array The configs changed at runtime.
$items array Blog config array.

Public Methods

Method Description
__construct ( ) Setting constructor.
all ( ) : array Get all setting item.
get ( string $key = null, string $default = null ) : array | null Get setting item.
rollback ( ) Rollback runtime change.
set ( string $key = null, string $value = null ) Set setting item.
update ( ) Update setting items, and store in driver.

Method Details

__construct() public method

Setting constructor.
public __construct ( )

all() public method

Get all setting item.
public all ( ) : array
return array

get() public method

Get setting item.
public get ( string $key = null, string $default = null ) : array | null
$key string
$default string
return array | null

rollback() public method

Rollback runtime change.
public rollback ( )

set() public method

IMPORTANT! : This function just change item at runtime. Saving change may call update function.
public set ( string $key = null, string $value = null )
$key string
$value string

update() public method

Update setting items, and store in driver.
public update ( )

Property Details

$changed protected property

The configs changed at runtime.
protected array $changed
return array

$items protected property

Blog config array.
protected array $items
return array