PHP Class Xpressengine\Register\Container

인터페이스 구성은 Illuminate\Config\Repository 와 유사합니다. 내부 아이템을 구성하기 위해서 Illuminate\Support\Arr 을 사용합니다. 이에 따라 key 를 구분할 때 dot(점, '.') 을 사용합니다. key 구성은 Illuminate config 사용에 대해서 검색하세요. Register 는 CoreRegister, PluginRegister, PluginRegistryManager 를 통해서 사용됩니다. ## 사용 ### set() * key 를 이용해서 value 를 등록합니다. php Register->set('key', $mixedValue); > 'key' 이미 있는경우 Exception 이 발생합니다. * key 를 array 로 사용 php Register->set([ 'key1' => $mixedValue1, 'key2' => $mixedValue2, ]); > key 유무에 상관없이 새로 등록됩니다. ### add() * key 를 이용해서 value 를 등록합니다. php Register->set('key', $mixedValue); > 'key' 가 없ㅇ면Exception 이 발생합니다. ### has() * key 가 있는지 체크합니다. ### get() * 'key' 의 정보를 반환합니다.
Author: XE Developers ([email protected])
Inheritance: implements Xpressengine\Register\RegisterInterface
Mostra file Open project: xpressengine/xpressengine Class Usage Examples

Protected Properties

Property Type Description
$arrClass Illuminate\Support\Arr Register 에서 array 를 처리하기 위한 class 이름 기본으로 Illuminate\Support\Arr 을 사용한다.
$items registered items

Public Methods

Method Description
__construct ( Illuminate\Support\Arr $arrClass )
add ( array | string $key, mixed $value ) : void 주어진 key에 value를 추가한다.
all ( ) : array 등록된 모든 아이템을 조회한다.
get ( string $key, mixed $default = null ) : mixed Get the specified configuration value.
has ( string $key ) : boolean Determine if the given configuration value exists.
offsetExists ( string $key ) : boolean Determine if the given configuration option exists.
offsetGet ( string $key ) : mixed Get a configuration option.
offsetSet ( string $key, mixed $value ) : void Set a configuration option.
offsetUnset ( string $key ) : void Unset a configuration option.
prepend ( string $key, mixed $value ) : void 주어진 키에 해당하는 array의 제일 앞에 value를 추가한다.
push ( string $key, mixed $id, mixed $value = null ) : void 주어진 키에 해당하는 array의 제일 뒤에 value를 추가한다.
set ( array | string $key, mixed $value = null ) : void 주어진 key에 value를 지정한다. 이미 지정된 value가 있다면 덮어씌운다.

Method Details

__construct() public method

public __construct ( Illuminate\Support\Arr $arrClass )
$arrClass Illuminate\Support\Arr array class name

add() public method

만약 해당 key에 지정된 value가 이미 있을 경우, 아무 행동도 하지 않는다.
public add ( array | string $key, mixed $value ) : void
$key array | string key
$value mixed value for adding
return void

all() public method

Get all of the configuration items for the application.
public all ( ) : array
return array

get() public method

Get the specified configuration value.
public get ( string $key, mixed $default = null ) : mixed
$key string key
$default mixed default value
return mixed

has() public method

Determine if the given configuration value exists.
public has ( string $key ) : boolean
$key string key
return boolean

offsetExists() public method

Determine if the given configuration option exists.
public offsetExists ( string $key ) : boolean
$key string key
return boolean

offsetGet() public method

Get a configuration option.
public offsetGet ( string $key ) : mixed
$key string key
return mixed

offsetSet() public method

Set a configuration option.
public offsetSet ( string $key, mixed $value ) : void
$key string key
$value mixed value for setting
return void

offsetUnset() public method

Unset a configuration option.
public offsetUnset ( string $key ) : void
$key string key
return void

prepend() public method

만약 주어진 키에 해당하는 array가 없다면 array를 생성후 추가한다.
public prepend ( string $key, mixed $value ) : void
$key string key
$value mixed value for prepend
return void

push() public method

만약 주어진 키에 해당하는 array가 없다면 array를 생성후 추가한다. Push a value onto an array configuration value.
public push ( string $key, mixed $id, mixed $value = null ) : void
$key string key
$id mixed pushed data's id
$value mixed pushed data's value
return void

set() public method

주어진 key에 value를 지정한다. 이미 지정된 value가 있다면 덮어씌운다.
public set ( array | string $key, mixed $value = null ) : void
$key array | string key
$value mixed value for setting
return void

Property Details

$arrClass protected_oe property

Register 에서 array 를 처리하기 위한 class 이름 기본으로 Illuminate\Support\Arr 을 사용한다.
protected Arr,Illuminate\Support $arrClass
return Illuminate\Support\Arr

$items protected_oe property

registered items
protected $items