PHP 클래스 Clinner\ValueHolder

저자: José Nahuel Cuesta Luengo ([email protected])
파일 보기 프로젝트 열기: ncuesta/clinner 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( array $initial = [] ) Constructor
__get ( $name ) Overridden in order to allow atribute-like accessor for values in the ValueHolder.
__set ( $name, $value ) Overridden in order to allow atribute-like setter for values in the ValueHolder.
count ( ) : integer Get the number of arguments set to this ValueHolder.
create ( array | ValueHolder $initial = [] ) : ValueHolder Create a new instance of ValueHolder with an optional initial set of values.
get ( string $name, mixed $default = null ) : mixed Get the value stored under key $name if it's set - otherwise return $default.
getAll ( ) : array Get all the values stored in this ValueHolder as an array.
isEmpty ( ) : boolean Answer whether this ValueHolder is empty.
reset ( ) : ValueHolder Reset this ValueHolder's values, clearing any of them.
set ( string $name, mixed $value ) : ValueHolder Set and store a value under key $name to $value.
setAll ( array $values ) : ValueHolder Set all the values stored in this ValueHolder to $values, destroying any previously-set ones.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( array $initial = [] )
$initial array (Optional) initial values for the ValueHolder.

__get() 공개 메소드

Overridden in order to allow atribute-like accessor for values in the ValueHolder.
public __get ( $name )

__set() 공개 메소드

Overridden in order to allow atribute-like setter for values in the ValueHolder.
public __set ( $name, $value )

count() 공개 메소드

Get the number of arguments set to this ValueHolder.
public count ( ) : integer
리턴 integer

create() 공개 정적인 메소드

$initial might either be an array or another instance of ValueHolder, in which case it will be returned as is.
public static create ( array | ValueHolder $initial = [] ) : ValueHolder
$initial array | ValueHolder (Optional) initial set of values.
리턴 ValueHolder

get() 공개 메소드

Get the value stored under key $name if it's set - otherwise return $default.
public get ( string $name, mixed $default = null ) : mixed
$name string The key name for the desired value.
$default mixed (Optional) a default value to return if $name is not set.
리턴 mixed

getAll() 공개 메소드

Get all the values stored in this ValueHolder as an array.
public getAll ( ) : array
리턴 array

isEmpty() 공개 메소드

Answer whether this ValueHolder is empty.
public isEmpty ( ) : boolean
리턴 boolean

reset() 공개 메소드

Reset this ValueHolder's values, clearing any of them.
public reset ( ) : ValueHolder
리턴 ValueHolder This instance, for a fluent API.

set() 공개 메소드

Set and store a value under key $name to $value.
public set ( string $name, mixed $value ) : ValueHolder
$name string The key name for the value to set.
$value mixed The value to set under key $name.
리턴 ValueHolder This instance, for a fluent API.

setAll() 공개 메소드

Set all the values stored in this ValueHolder to $values, destroying any previously-set ones.
public setAll ( array $values ) : ValueHolder
$values array The new values to set.
리턴 ValueHolder This instance, for a fluent API.