PHP 클래스 BookStack\Services\SettingService

The settings are a simple key-value database store.
파일 보기 프로젝트 열기: ssddanbrown/bookstack

보호된 프로퍼티들

프로퍼티 타입 설명
$cache
$cachePrefix
$setting

공개 메소드들

메소드 설명
__construct ( Setting $setting, Illuminate\Contracts\Cache\Repository $cache ) SettingService constructor.
get ( $key, string | boolean $default = false ) : boolean | string Gets a setting from the database, If not found, Returns default, Which is false by default.
has ( $key ) : boolean Checks if a setting exists.
put ( $key, $value ) : boolean Add a setting to the database.
remove ( $key ) : boolean Removes a setting from the database.

보호된 메소드들

메소드 설명
clearFromCache ( $key ) Clear an item from the cache completely.
formatValue ( $value, $default ) : mixed Format a settings value
getOverrideValue ( $key ) : boolean | null Returns an override value for a setting based on certain app conditions.
getSettingObjectByKey ( $key ) : mixed Gets a setting model from the database for the given key.
getValueFromStore ( $key, $default ) : mixed Gets a setting value from the cache or database.

메소드 상세

__construct() 공개 메소드

SettingService constructor.
public __construct ( Setting $setting, Illuminate\Contracts\Cache\Repository $cache )
$setting BookStack\Setting
$cache Illuminate\Contracts\Cache\Repository

clearFromCache() 보호된 메소드

Clear an item from the cache completely.
protected clearFromCache ( $key )
$key

formatValue() 보호된 메소드

Format a settings value
protected formatValue ( $value, $default ) : mixed
$value
$default
리턴 mixed

get() 공개 메소드

Gets a setting from the database, If not found, Returns default, Which is false by default.
public get ( $key, string | boolean $default = false ) : boolean | string
$key
$default string | boolean
리턴 boolean | string

getOverrideValue() 보호된 메소드

Used where certain configuration options overrule others. Returns null if no override value is available.
protected getOverrideValue ( $key ) : boolean | null
$key
리턴 boolean | null

getSettingObjectByKey() 보호된 메소드

Gets a setting model from the database for the given key.
protected getSettingObjectByKey ( $key ) : mixed
$key
리턴 mixed

getValueFromStore() 보호된 메소드

Looks at the system defaults if not cached or in database.
protected getValueFromStore ( $key, $default ) : mixed
$key
$default
리턴 mixed

has() 공개 메소드

Checks if a setting exists.
public has ( $key ) : boolean
$key
리턴 boolean

put() 공개 메소드

Add a setting to the database.
public put ( $key, $value ) : boolean
$key
$value
리턴 boolean

remove() 공개 메소드

Removes a setting from the database.
public remove ( $key ) : boolean
$key
리턴 boolean

프로퍼티 상세

$cache 보호되어 있는 프로퍼티

protected $cache

$cachePrefix 보호되어 있는 프로퍼티

protected $cachePrefix

$setting 보호되어 있는 프로퍼티

protected $setting