PHP 클래스 Elastica\Param

This function can be used to handle params for queries, filter
저자: Nicolas Ruflin ([email protected])
상속: implements elastica\ArrayableInterface
파일 보기 프로젝트 열기: ruflin/elastica 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_params array Params.
$_rawParams array Raw Params.

공개 메소드들

메소드 설명
addParam ( string $key, mixed $value ) Adds a param to the list.
getParam ( string $key ) : mixed Returns a specific param.
getParams ( ) : array Returns the params array.
hasParam ( string $key ) : boolean Test if a param is set.
setParam ( string $key, mixed $value ) Sets (overwrites) the value at the given key.
setParams ( array $params ) Sets (overwrites) all params of this object.
toArray ( ) : array Converts the params to an array. A default implementation exist to create the an array out of the class name (last part of the class name) and the params.

보호된 메소드들

메소드 설명
_convertArrayable ( array $array ) : array Cast objects to arrays.
_getBaseName ( ) : string Param's name Picks the last part of the class name and makes it snake_case You can override this method if you want to change the name.
_setRawParam ( string $key, mixed $value ) Sets params not inside params array.

메소드 상세

_convertArrayable() 보호된 메소드

Cast objects to arrays.
protected _convertArrayable ( array $array ) : array
$array array
리턴 array

_getBaseName() 보호된 메소드

Param's name Picks the last part of the class name and makes it snake_case You can override this method if you want to change the name.
protected _getBaseName ( ) : string
리턴 string name

_setRawParam() 보호된 메소드

Sets params not inside params array.
protected _setRawParam ( string $key, mixed $value )
$key string
$value mixed

addParam() 공개 메소드

This function can be used to add an array of params
public addParam ( string $key, mixed $value )
$key string Param key
$value mixed Value to set

getParam() 공개 메소드

Returns a specific param.
public getParam ( string $key ) : mixed
$key string Key to return
리턴 mixed Key value

getParams() 공개 메소드

Returns the params array.
public getParams ( ) : array
리턴 array Params

hasParam() 공개 메소드

Test if a param is set.
public hasParam ( string $key ) : boolean
$key string Key to test
리턴 boolean True if the param is set, false otherwise

setParam() 공개 메소드

Sets (overwrites) the value at the given key.
public setParam ( string $key, mixed $value )
$key string Key to set
$value mixed Key Value

setParams() 공개 메소드

Sets (overwrites) all params of this object.
public setParams ( array $params )
$params array Parameter list

toArray() 공개 메소드

Converts the params to an array. A default implementation exist to create the an array out of the class name (last part of the class name) and the params.
public toArray ( ) : array
리턴 array Filter array

프로퍼티 상세

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

Params.
protected array $_params
리턴 array

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

Raw Params.
protected array $_rawParams
리턴 array