interface ExtendedResponseInterface implements ResponseInterface (View source)

Extended Response Interface

The optional capabilities of a richer API surface (currently CentralNic Reseller): server-side telemetry (queuetime/runtime), transient/pending status signals and the table-friendly list-hash projection. These are NOT part of the universal {\CNIC\ResponseInterface} because flat APIs such as IBS/Moniker do not provide them — their responses implement the core interface only. Consumers holding the shared type narrow to this one via instanceof ExtendedResponseInterface before using any of these methods.

Methods

int
getCode()

Get API response code

string
getDescription()

Get API response description

string
getRequestURL()

Get Request URL

string
getPlain()

Get Plain API response

array
getHash()

Get API response as Hash

bool
isError()

Check if current API response represents an error case (a 5xx code)

bool
isSuccess()

Check if current API response represents a success case (a 2xx code)

addColumn(string $columnName, array $data)

Add a column to the column list

addRecord(array $row)

Add a record to the record list

getColumn(string $columnName)

Get column by column name, or null if the column does not exist

mixed
getColumnIndex(string $columnName, int $recordIndex)

Get Data by Column Name and Index, or null if not found

array
getColumnKeys(bool $filterPaginationKeys = false)

Get Column Names

array
getColumns()

Get List of Columns

array
getCommand()

Get Command used in this request

string
getCommandPlain()

Get Command used in this request in plain text format

array
getContext()

Get context data for the response

int|null
getCurrentPageNumber()

Get Page Number of current List Query, or null for a non-list response

getCurrentRecord()

Get Record of current record index, or null for a non-list response

int|null
getFirstRecordIndex()

Get Index of first row in this response

int|null
getLastRecordIndex()

Get last record index of the current list query, or null for a non-list response

getNextRecord()

Get next record in record list, or null if there is no further record

int|null
getNextPageNumber()

Get Page Number of next list query, or null if there is no next page

int
getNumberOfPages()

Get the number of pages available for this list query

array
getPagination()

Get object containing all paging data

int|null
getPreviousPageNumber()

Get Page Number of previous list query, or null if there is no previous page

getPreviousRecord()

Get previous record in record list, or null if there is no previous record

getRecord(int $recordIndex)

Get Record at given index, or null if the index does not exist

array
getRecords()

Get all Records

int
getRecordsCount()

Get count of rows in this response

int
getRecordsTotalCount()

Get total count of records available for the list query, or the count of records for a non-list response

int
getRecordsLimitation()

Get limit(ation) setting of the current list query — the count of requested rows

bool
hasNextPage()

Check if this list query has a next page

bool
hasPreviousPage()

Check if this list query has a previous page

rewindRecordList()

Reset index in record list back to zero

float
getQueuetime()

Get Queuetime of API response

float
getRuntime()

Get Runtime of API response

bool
isTmpError()

Check if current API response represents a temporary error case (a 4xx code)

bool
isPending()

Check if current operation is returned as pending

array
getListHash()

Get Response as List Hash including useful meta data for tables

Details

int getCode()

Get API response code

Return Value

int

string getDescription()

Get API response description

Return Value

string

string getRequestURL()

Get Request URL

Return Value

string

string getPlain()

Get Plain API response

Return Value

string

array getHash()

Get API response as Hash

Return Value

array

API response hash

bool isError()

Check if current API response represents an error case (a 5xx code)

Return Value

bool

bool isSuccess()

Check if current API response represents a success case (a 2xx code)

Return Value

bool

ResponseInterface addColumn(string $columnName, array $data)

Add a column to the column list

Parameters

string $columnName
array $data

array of column data

Return Value

ResponseInterface

ResponseInterface addRecord(array $row)

Add a record to the record list

Parameters

array $row

Return Value

ResponseInterface

ColumnInterface|null getColumn(string $columnName)

Get column by column name, or null if the column does not exist

Parameters

string $columnName

Return Value

ColumnInterface|null

mixed getColumnIndex(string $columnName, int $recordIndex)

Get Data by Column Name and Index, or null if not found

Parameters

string $columnName
int $recordIndex

Return Value

mixed

array getColumnKeys(bool $filterPaginationKeys = false)

Get Column Names

Pass true to strip the pagination/metadata columns the brand's list endpoints emit alongside the real data (CNR: TOTAL, FIRST, LAST, COUNT, LIMIT; IBS: the total_ prefixed keys and domaincount), leaving only the columns a caller wants to render. Which keys count as pagination is brand-specific — see the $paginationKeys property on each brand's Response.

The parameter is declared here, not only on the implementation, because consumers are expected to type against this interface: an interface declaration narrower than the implementation makes the capability unreachable to exactly those consumers. Keep the two in step.

Parameters

bool $filterPaginationKeys

Return Value

array

Array of Column Names

array getColumns()

Get List of Columns

Return Value

array

Array of Columns

array getCommand()

Get Command used in this request

Return Value

array command

string getCommandPlain()

Get Command used in this request in plain text format

Return Value

string

array getContext()

Get context data for the response

Return Value

array

context data

int|null getCurrentPageNumber()

Get Page Number of current List Query, or null for a non-list response

Return Value

int|null

RecordInterface|null getCurrentRecord()

Get Record of current record index, or null for a non-list response

Return Value

RecordInterface|null

int|null getFirstRecordIndex()

Get Index of first row in this response

Return Value

int|null

int|null getLastRecordIndex()

Get last record index of the current list query, or null for a non-list response

Return Value

int|null

RecordInterface|null getNextRecord()

Get next record in record list, or null if there is no further record

Return Value

RecordInterface|null

int|null getNextPageNumber()

Get Page Number of next list query, or null if there is no next page

Return Value

int|null

int getNumberOfPages()

Get the number of pages available for this list query

Return Value

int

array getPagination()

Get object containing all paging data

Return Value

array

paginator data

int|null getPreviousPageNumber()

Get Page Number of previous list query, or null if there is no previous page

Return Value

int|null

RecordInterface|null getPreviousRecord()

Get previous record in record list, or null if there is no previous record

Return Value

RecordInterface|null

RecordInterface|null getRecord(int $recordIndex)

Get Record at given index, or null if the index does not exist

Parameters

int $recordIndex

Return Value

RecordInterface|null

array getRecords()

Get all Records

Return Value

array

array of records

int getRecordsCount()

Get count of rows in this response

Return Value

int

int getRecordsTotalCount()

Get total count of records available for the list query, or the count of records for a non-list response

Return Value

int

int getRecordsLimitation()

Get limit(ation) setting of the current list query — the count of requested rows

Return Value

int

bool hasNextPage()

Check if this list query has a next page

Return Value

bool

bool hasPreviousPage()

Check if this list query has a previous page

Return Value

bool

ResponseInterface rewindRecordList()

Reset index in record list back to zero

Return Value

ResponseInterface

float getQueuetime()

Get Queuetime of API response

Return Value

float

float getRuntime()

Get Runtime of API response

Return Value

float

bool isTmpError()

Check if current API response represents a temporary error case (a 4xx code)

Return Value

bool

bool isPending()

Check if current operation is returned as pending

Return Value

bool

array getListHash()

Get Response as List Hash including useful meta data for tables

Return Value

array

hash including list meta data and array of rows in hash notation