PHP SDK by CNIC

ResponseInterface
in

Common Response Interface

Table of Contents

__construct()  : mixed
Constructor
addColumn()  : ResponseInterface
Add a column to the column list
addRecord()  : ResponseInterface
Add a record to the record list
getCode()  : int
Get API response code
getColumn()  : ColumnInterface|null
Get column by column name
getColumnIndex()  : string|null
Get Data by Column Name and Index
getColumnKeys()  : array<string|int, string>
Get Column Names
getColumns()  : array<string|int, ColumnInterface>
Get List of Columns
getCommand()  : array<string|int, string>
Get Command used in this request
getCommandPlain()  : string
Get Command used in this request in plain text format
getCurrentPageNumber()  : int|null
Get Page Number of current List Query
getCurrentRecord()  : RecordInterface|null
Get Record of current record index
getDescription()  : string
Get API response description
getFirstRecordIndex()  : int|null
Get Index of first row in this response
getHash()  : array<string|int, string>
Get API response as Hash
getLastRecordIndex()  : int|null
Get last record index of the current list query
getListHash()  : array<string|int, string>
Get Response as List Hash including useful meta data for tables
getNextPageNumber()  : int|null
Get Page Number of next list query
getNextRecord()  : RecordInterface|null
Get next record in record list
getNumberOfPages()  : int
Get the number of pages available for this list query
getPagination()  : array<string|int, string>
Get object containing all paging data
getPlain()  : string
Get Plain API response
getPreviousPageNumber()  : int|null
Get Page Number of previous list query
getPreviousRecord()  : RecordInterface|null
Get previous record in record list
getQueuetime()  : float
Get Queuetime of API response
getRecord()  : RecordInterface|null
Get Record at given index
getRecords()  : array<string|int, RecordInterface>
Get all Records
getRecordsCount()  : int
Get count of rows in this response
getRecordsLimitation()  : int
Get limit(ation) setting of the current list query This is the count of requested rows
getRecordsTotalCount()  : int
Get total count of records available for the list query
getRuntime()  : float
Get Runtime of API response
hasNextPage()  : bool
Check if this list query has a next page
hasPreviousPage()  : bool
Check if this list query has a previous page
isError()  : bool
Check if current API response represents an error case API response code is an 5xx code
isPending()  : bool
Check if current operation is returned as pending
isSuccess()  : bool
Check if current API response represents a success case API response code is an 2xx code
isTmpError()  : bool
Check if current API response represents a temporary error case API response code is an 4xx code
rewindRecordList()  : ResponseInterface
Reset index in record list back to zero

Methods

__construct()

Constructor

public __construct(string $raw, array<string|int, string> $cmd[, array<string|int, string> $ph = [] ]) : mixed
Parameters
$raw : string

API plain response

$cmd : array<string|int, string>

API command used within this request

$ph : array<string|int, string> = []

placeholder array to get vars in response description dynamically replaced

Return values
mixed

addColumn()

Add a column to the column list

public addColumn(string $key, array<string|int, string> $data) : ResponseInterface
Parameters
$key : string

column name

$data : array<string|int, string>

array of column data

Return values
ResponseInterface

getCode()

Get API response code

public getCode() : int
Return values
int

API response code

getColumnIndex()

Get Data by Column Name and Index

public getColumnIndex(string $colkey, int $index) : string|null
Parameters
$colkey : string

column name

$index : int

column data index

Return values
string|null

column data at index or null if not found

getColumnKeys()

Get Column Names

public getColumnKeys() : array<string|int, string>
Return values
array<string|int, string>

Array of Column Names

getCommand()

Get Command used in this request

public getCommand() : array<string|int, string>
Return values
array<string|int, string>

command

getCommandPlain()

Get Command used in this request in plain text format

public getCommandPlain() : string
Return values
string

command

getCurrentPageNumber()

Get Page Number of current List Query

public getCurrentPageNumber() : int|null
Return values
int|null

page number or null in case of a non-list response

getDescription()

Get API response description

public getDescription() : string
Return values
string

API response description

getFirstRecordIndex()

Get Index of first row in this response

public getFirstRecordIndex() : int|null
Return values
int|null

first row index

getHash()

Get API response as Hash

public getHash() : array<string|int, string>
Return values
array<string|int, string>

API response hash

getLastRecordIndex()

Get last record index of the current list query

public getLastRecordIndex() : int|null
Return values
int|null

record index or null for a non-list response

getListHash()

Get Response as List Hash including useful meta data for tables

public getListHash() : array<string|int, string>
Return values
array<string|int, string>

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

getNextPageNumber()

Get Page Number of next list query

public getNextPageNumber() : int|null
Return values
int|null

page number or null if there's no next page

getNumberOfPages()

Get the number of pages available for this list query

public getNumberOfPages() : int
Return values
int

number of pages

getPagination()

Get object containing all paging data

public getPagination() : array<string|int, string>
Return values
array<string|int, string>

paginator data

getPlain()

Get Plain API response

public getPlain() : string
Return values
string

Plain API response

getPreviousPageNumber()

Get Page Number of previous list query

public getPreviousPageNumber() : int|null
Return values
int|null

page number or null if there's no previous page

getQueuetime()

Get Queuetime of API response

public getQueuetime() : float
Return values
float

Queuetime of API response

getRecordsCount()

Get count of rows in this response

public getRecordsCount() : int
Return values
int

count of rows

getRecordsLimitation()

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

public getRecordsLimitation() : int
Return values
int

limit setting or count requested rows

getRecordsTotalCount()

Get total count of records available for the list query

public getRecordsTotalCount() : int
Return values
int

total count of records or count of records for a non-list response

getRuntime()

Get Runtime of API response

public getRuntime() : float
Return values
float

Runtime of API response

hasNextPage()

Check if this list query has a next page

public hasNextPage() : bool
Return values
bool

boolean result

hasPreviousPage()

Check if this list query has a previous page

public hasPreviousPage() : bool
Return values
bool

boolean result

isError()

Check if current API response represents an error case API response code is an 5xx code

public isError() : bool
Return values
bool

boolean result

isPending()

Check if current operation is returned as pending

public isPending() : bool
Return values
bool

result

isSuccess()

Check if current API response represents a success case API response code is an 2xx code

public isSuccess() : bool
Return values
bool

boolean result

isTmpError()

Check if current API response represents a temporary error case API response code is an 4xx code

public isTmpError() : bool
Return values
bool

result

Search results