PHP 트레잇 Bluz\Common\Options

Example of usage class Foo { use \Bluz\Common\Options; protected $bar = ''; protected $baz = ''; public function setBar($value) { $this->bar = $value; } public function setBaz($value) { $this->baz = $value; } } $Foo = new Foo(['bar'=>123, 'baz'=>456]);
저자: Anton Shevchuk
파일 보기 프로젝트 열기: bluzphp/framework

보호된 프로퍼티들

프로퍼티 타입 설명
$options options store

공개 메소드들

메소드 설명
getOption ( string $key, string | null $section = null ) : mixed Get option by key
getOptions ( ) : array Get all options
setOption ( string $key, string $value ) : void Set option by key over setter
setOptions ( array $options ) : self Setup, check and init options

보호된 메소드들

메소드 설명
initOptions ( ) : void Check and initialize options in package

비공개 메소드들

메소드 설명
normalizeKey ( string $key ) : string Normalize key name

메소드 상세

getOption() 공개 메소드

Get option by key
public getOption ( string $key, string | null $section = null ) : mixed
$key string
$section string | null
리턴 mixed

getOptions() 공개 메소드

Get all options
public getOptions ( ) : array
리턴 array

initOptions() 보호된 메소드

Check and initialize options in package
protected initOptions ( ) : void
리턴 void

setOption() 공개 메소드

Set option by key over setter
public setOption ( string $key, string $value ) : void
$key string
$value string
리턴 void

setOptions() 공개 메소드

Requirements - options must be a array - options can be null
public setOptions ( array $options ) : self
$options array
리턴 self

프로퍼티 상세

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

options store
protected $options