PHP Class Elastica\Cluster\Settings

Show file Open project: ruflin/elastica Class Usage Examples

Protected Properties

Property Type Description
$_client Client object

Public Methods

Method Description
__construct ( Client $client ) Creates a cluster object.
get ( ) : array Returns settings data.
getClient ( ) : Client Get the client.
getPersistent ( string $setting = '' ) : array | string | null Returns the current persistent settings of the cluster.
getTransient ( string $setting = '' ) : array | string | null Returns the current transient settings of the cluster.
request ( array $data = [], string $method = Request::GET ) : Response Sends settings request.
set ( array $settings ) : Response Set settings for cluster.
setPersistent ( string $key, string $value ) : Response Sets persistent setting.
setReadOnly ( boolean $readOnly = true, boolean $persistent = false ) : Response Sets the cluster to read only.
setTransient ( string $key, string $value ) : Response Sets transient settings.

Method Details

__construct() public method

Creates a cluster object.
public __construct ( Client $client )
$client Elastica\Client Connection client object

get() public method

Returns settings data.
public get ( ) : array
return array Settings data (persistent and transient)

getClient() public method

Get the client.
public getClient ( ) : Client
return Elastica\Client

getPersistent() public method

If param is set, only specified setting is return.
public getPersistent ( string $setting = '' ) : array | string | null
$setting string OPTIONAL Setting name to return
return array | string | null Settings data

getTransient() public method

If param is set, only specified setting is return.
public getTransient ( string $setting = '' ) : array | string | null
$setting string OPTIONAL Setting name to return
return array | string | null Settings data

request() public method

Sends settings request.
public request ( array $data = [], string $method = Request::GET ) : Response
$data array OPTIONAL Data array
$method string OPTIONAL Transfer method (default = \Elastica\Request::GET)
return Elastica\Response Response object

set() public method

Set settings for cluster.
public set ( array $settings ) : Response
$settings array Raw settings (including persistent or transient)
return Elastica\Response

setPersistent() public method

Sets persistent setting.
public setPersistent ( string $key, string $value ) : Response
$key string
$value string
return Elastica\Response

setReadOnly() public method

Second param can be used to set it persistent
public setReadOnly ( boolean $readOnly = true, boolean $persistent = false ) : Response
$readOnly boolean
$persistent boolean
return Elastica\Response $response

setTransient() public method

Sets transient settings.
public setTransient ( string $key, string $value ) : Response
$key string
$value string
return Elastica\Response

Property Details

$_client protected property

Client object
protected $_client