ExtendedResponseInterface
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
Check if current API response represents an error case (a 5xx code)
Check if current API response represents a success case (a 2xx code)
Add a column to the column list
Get column by column name, or null if the column does not exist
Get Data by Column Name and Index, or null if not found
Get Command used in this request in plain text format
Get Page Number of current List Query, or null for a non-list response
Get Record of current record index, or null for a non-list response
Get last record index of the current list query, or null for a non-list response
Get next record in record list, or null if there is no further record
Get Page Number of next list query, or null if there is no next page
Get Page Number of previous list query, or null if there is no previous page
Get previous record in record list, or null if there is no previous record
Get Record at given index, or null if the index does not exist
Get total count of records available for the list query, or the count of records for a non-list response
Get limit(ation) setting of the current list query — the count of requested rows
Get Queuetime of API response
Get Runtime of API response
Check if current API response represents a temporary error case (a 4xx code)
Check if current operation is returned as pending
Get Response as List Hash including useful meta data for tables
Details
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)
ResponseInterface
addColumn(string $columnName, array $data)
Add a column to the column list
ResponseInterface
addRecord(array $row)
Add a record to the record list
ColumnInterface|null
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
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.
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
RecordInterface|null
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
RecordInterface|null
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
RecordInterface|null
getPreviousRecord()
Get previous record in record list, or null if there is no previous record
RecordInterface|null
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
ResponseInterface
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