Column
class Column extends Column (View source)
CNR Column
CNR responses are plaintext, so every column value is a string. This subclass
exists purely to say so: it binds the shared column's TValue to string and
narrows getDataByIndex() from mixed to ?string for callers holding a
CNR-typed column. All behaviour is inherited — see {\CNIC\Column}.
Properties
| int | $length | count of column data entries |
from Column |
Methods
Get column data at given index
Get column data at given index, parsed as a date/time value.
Details
in
Column at line 40
__construct(string $columnName, array $data)
Constructor
in
Column at line 50
string
getKey()
Get column name
in
Column at line 60
array
getData()
Get column data
mixed
getDataByIndex(int $recordIndex)
Get column data at given index
in
Column at line 93
ApiDateTime|null
getDateTimeByIndex(int $recordIndex)
Get column data at given index, parsed as a date/time value.
Opt-in narrowing over {\CNIC\self::getDataByIndex()}: returns null for
an out-of-range index, a non-string value, or a string
{\CNIC\ApiDateTime::tryFrom()} cannot parse. There is no throwing variant
here — use ApiDateTime::from($col->getDataByIndex($recordIndex)) directly
if an unparsable value should be a loud failure instead.