Response

The response received from the REDIS server. Redis responses can have several representations:

  • simple string - C string
  • integer - 64bit integer value
  • bulk - byte array
  • multi - list

Due to the dynamic nature the response object will try to cast the received response to the desired type. A special case should be noted that multi responses are also handled by the response object as it implements the iterable interface. So in this case constructs like for loops on the response will give you access to the underlying elements.

package

Default

Methods

__construct

__construct() 

Get this multi response value at a numerical index.

get( $arg0) : \io\vertx\jphp\redis\client\Response

param $index [integer] the required index. get($index)

Get this multi response value at a string key. Note that REDIS does not support strings as keys but by convention it encodes hashes in lists where index i is the key, and index i+1 is the value.

param $key [string] the required key. get($key)

Arguments

$arg0

string | integer

Response

\io\vertx\jphp\redis\client\Response

Response value.

Get this multi response keys from a hash. Note that REDIS does not support strings as keys but by convention it encodes hashes in lists where index i is the key, and index i+1 is the value.

getKeys() : array

Response

array

the set of keys.

Get this size of this multi response.

size() : integer

Response

integer

the size of the multi.

Get this response as a Boolean.

toBoolean() : boolean

Response

boolean

boolean value.

Get this response as Buffer.

toBuffer() : \io\vertx\jphp\core\buffer\Buffer

Response

\io\vertx\jphp\core\buffer\Buffer

buffer value.

Get this response as a Byte.

toByte() : integer

Response

integer

byte value.

Get this response as a Integer.

toInteger() : integer

Response

integer

int value.

Get this response as a Long.

toLong() : integer

Response

integer

long value.

Get this response as a Short.

toShort() : integer

Response

integer

short value.

Get this response as a String.

toString() : string

Response

string

string value

The response return type.

type() : string

Response

string

the type.