Record
class Record implements RecordInterface (View source)
Shared Record implementation
Brand-neutral record (row) of a list response. Record data has one shape across brands (array<string,mixed>) and no brand has ever needed to read a row differently, so there is exactly one Record and every Response's newRecord() factory hook returns it. The hook itself stays a per-brand declaration: a brand that genuinely needs different row behaviour implements RecordInterface and returns that from its own newRecord() instead.
Methods
Constructor e.g.
get row data
get row data for given column
Get row data for given column, parsed as a date/time value.
Details
__construct(array $data)
Constructor e.g.
$data = [
"DOMAIN" => "mydomain.com",
"USER" => "test.user",
// ... further column data ...
];
array
getData()
get row data
mixed
getDataByKey(string $columnName)
get row data for given column
ApiDateTime|null
getDateTimeByKey(string $columnName)
Get row data for given column, parsed as a date/time value.
Opt-in narrowing over {\CNIC\self::getDataByKey()}: returns null for a
missing key, a non-string value, or a string {\CNIC\ApiDateTime::tryFrom()}
cannot parse. There is no throwing variant here — use
ApiDateTime::from($rec->getDataByKey($columnName)) directly if an
unparsable value should be a loud failure instead.