PHP Class App\Services\Repositories\OptionRepository

Inheritance: extends Repository
Datei anzeigen Open project: printempw/blessing-skin-server Class Usage Examples

Public Methods

Method Description
__construct ( ) : void Create a new option repository.
__destruct ( ) Save all modified options into database
get ( string $key, mixed $default = null, boolean $bool = true ) : mixed Get the specified option value.
only ( array $array ) : array Return the options with key in the given array.
prepend ( string $key, mixed $value ) : void Prepend a value onto an array option value.
save ( ) : void Do really save modified options to database.

Method Details

__construct() public method

Create a new option repository.
public __construct ( ) : void
return void

__destruct() public method

Save all modified options into database
public __destruct ( )

get() public method

Get the specified option value.
public get ( string $key, mixed $default = null, boolean $bool = true ) : mixed
$key string
$default mixed
$bool boolean convert '0', '1' to bool value
return mixed

only() public method

Return the options with key in the given array.
public only ( array $array ) : array
$array array
return array

prepend() public method

Prepend a value onto an array option value.
public prepend ( string $key, mixed $value ) : void
$key string
$value mixed
return void

save() public method

Do really save modified options to database.
public save ( ) : void
return void