Response
class Response extends Response implements ResponseInterface (View source)
IBS Response
Extends CNR\Response and only overrides what genuinely differs for the IBS platform: the JSON-shaped response parsing (constructor), the status/code/ description accessors, the IBS column type, the not-supported contract methods and the flat (single-page) pagination model. Every other accessor and the record-cursor navigation are inherited unchanged from CNR\Response.
Properties
| protected array<string, string> | $command | The API Command used within this request |
from Response |
| protected string | $raw | plain API response |
from Response |
| protected array<string, mixed> | $hash | hash representation of plain API response |
from Response |
| protected non-empty-string | $paginationkeys | Regex for pagination related column keys |
|
| protected string[] | $columnkeys | Column names available in this response |
from Response |
| protected ColumnInterface[] | $columns | Container of Column Instances |
from Response |
| protected int | $recordIndex | Record Index we currently point to in record list |
from Response |
| protected Record[] | $records | Record List (List of rows) |
from Response |
| protected array<string, mixed> | $context | Context data for the response |
from Response |
| protected string | $requestUrl | API request url |
from Response |
Methods
Constructor
Get API response code
Get API response description
Get Queuetime of API response
Get Runtime of API response
Check if current API response represents an error case
Check if current API response represents a success case
Check if current API response represents a temporary error case
Check if current operation is returned as pending
Add a column to the column list
Get Page Number of current List Query
Get Index of first row in this response
Get last record index of the current list query
Get Response as List Hash including useful meta data for tables
Get total count of records available for the list query
Get limit(ation) setting of the current list query This is the count of requested rows
Check if this list query has a next page
Check if this list query has a previous page
Check if the record list contains a record for the current record index in use
Check if the record list contains a next record for the current record index in use
Check if the record list contains a previous record for the current record index in use
Get a string value from the hash by key, returning a default if not found or not a string
Get API response status
Details
__construct(string $raw, array $cmd = [], array $ph = [], array $context = [])
Constructor
array
getContext()
Get context data for the response
string
getRequestURL()
Get Request URL
int
getCode()
Get API response code
string
getDescription()
Get API response description
string
getPlain()
Get Plain API response
float
getQueuetime()
Get Queuetime of API response
array
getHash()
Get API response as Hash
float
getRuntime()
Get Runtime of API response
bool
isError()
Check if current API response represents an error case
bool
isSuccess()
Check if current API response represents a success case
bool
isTmpError()
Check if current API response represents a temporary error case
bool
isPending()
Check if current operation is returned as pending
ResponseInterface
addColumn(string $key, array $data)
Add a column to the column list
ResponseInterface
addRecord(array $h)
Add a record to the record list
ColumnInterface|null
getColumn(string $key)
Get column by column name
mixed
getColumnIndex(string $colkey, int $index)
Get Data by Column Name and Index
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
int|null
getCurrentPageNumber()
Get Page Number of current List Query
RecordInterface|null
getCurrentRecord()
Get Record of current record index
int|null
getFirstRecordIndex()
Get Index of first row in this response
int|null
getLastRecordIndex()
Get last record index of the current list query
array
getListHash()
Get Response as List Hash including useful meta data for tables
RecordInterface|null
getNextRecord()
Get next record in record list
int|null
getNextPageNumber()
Get Page Number of next list query
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
RecordInterface|null
getPreviousRecord()
Get previous record in record list
RecordInterface|null
getRecord(int $idx)
Get Record at given index
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
int
getRecordsLimitation()
Get limit(ation) setting of the current list query This is 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
protected bool
hasColumn(string $key)
Check if column exists in response
protected bool
hasCurrentRecord()
Check if the record list contains a record for the current record index in use
protected bool
hasNextRecord()
Check if the record list contains a next record for the current record index in use
protected bool
hasPreviousRecord()
Check if the record list contains a previous record for the current record index in use
protected string
getHashString(string $key, string $default = "")
Get a string value from the hash by key, returning a default if not found or not a string
string
getStatus()
Get API response status