Response

Implements \ArrayAccess, \Iterator, \Countable

ISPAPI Response

package

ISPAPI

Methods

Constructor

__construct(\ISPAPI\Response $response) 

Arguments

$response

\ISPAPI\Response

A response as a string

Returns the response as a string

as_string() : string

Response

string

The response as a sting

Returns the response as a hash

as_hash() : array

Response

array

The response as a hash

Returns the response as a list hash

as_list_hash() : array

Response

array

The response as a list hash

Returns the response as a list

as_list() : array

Response

array

The response as a list

Returns the response code

code() : int

Response

int

The response code

Returns the response description

description() : string

Response

string

The response description

Returns the response properties

properties() : array

Response

array

The response properties

Returns the response runtime

runtime() : float

Response

float

The response runtime

Returns the response queutime

queuetime() : float

Response

float

The response queutime

Returns the property for a given index If no index given, the complete property list is returned

property(int $index = null) : array

Arguments

$index

int

The index of the property

Response

array

A proterty

Returns true if the results is a success Success = response code starting with 2

is_success() : boolean

Response

boolean

Returns true if the results is a tmp error tmp error = response code starting with 4

is_tmp_error() : boolean

Response

boolean

Operator overloading Example: __get("code") == $response->code

__get(string $name) 

Arguments

$name

string

An array key

ArrayAccess : offsetSet not implemented

offsetSet(int $offset, string $value) 

Arguments

$offset

int

An array key

$value

string

A value

ArrayAccess : offsetExists Return true if the array key exists

offsetExists(int $offset) 

Arguments

$offset

int

An array key

ArrayAcess : offsetUnset not implemented

offsetUnset(int $offset) 

Arguments

$offset

int

An array key

ArrayAccess : offsetGet Return the array for the given offset

offsetGet(int $offset) 

Arguments

$offset

int

An array key

Returns the columns

columns() : array

Response

array

The columns

Returns the index of the first element

first() : int

Response

int

The index of the first element

Returns the index of the last element

last() : int

Response

int

The index of the last element

Returns the number of list elements returned (= last - first + 1)

count() : int

Response

int

The number of list elements returned

Returns the limit of the response

limit() : int

Response

int

The limit

Returns the total number of elements found (!= count)

total() : int

Response

int

The total number of elements found

Returns the number of pages

pages() : int

Response

int

The number of pages

Returns the number of the current page (starts with 1)

page() : int

Response

int

The number of the current page

Returns the number of the previous page

prevpage() : int

Response

int

The number of the previous page

Returns the first index for the previous page

prevpagefirst() : int

Response

int

The first index of the previous page

Returns the number of the next page

nextpage() : int

Response

int

The number of the next page

Returns the first index for the next page

nextpagefirst() : int

Response

int

The first index of the next page

Returns the first index for the last page

lastpagefirst() : int

Response

int

The first index of the last page

Iterator : rewind Set the iterator to 0

rewind() : array

Response

array

The first element of the list

Iterator : current Returns the current element of the list

current() : array

Response

array

The current element of the list

Iterator : key Returns the key of the current element

key() : int

Response

int

The key of the current element

Iterator : next Returns the key of the next element

next() : int

Response

int

The key of the next element

Iterator : valid Returns the element if it exists

valid() : array

Response

array

The element if it exists

Properties

Iterator for the Iterator class

iterator_position : int
var

Type(s)

int

Contains the response as a string

response_string : string
var

Type(s)

string

Contains the response as a hash

response_hash : array
var

Type(s)

array

Contains the response as a list hash

response_list_hash : array
var

Type(s)

array