PHP Класс Elastica\Param

This function can be used to handle params for queries, filter
Автор: Nicolas Ruflin ([email protected])
Наследование: implements elastica\ArrayableInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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