Open pawelkmpt opened 5 years ago
I agree, this makes sense, since doesnt seem to have any side-effects:
The current() function simply returns the value of the array element that's currently being pointed to by the internal pointer. It does not move the pointer in any way.
@pawelkmpt what's the secific use case for us? Why are non-integer keys better?
I see, may be you following command to convert the array to using numeric keys before inserting to ArrayDataSource
$data = array_values($data);
I encountered following issue
PHP Notice: Undefined offset: 0 in .../koolphp/koolreport/src/datasources/ArrayDataSource.php on line 111
when used associative array with keys different than integers. As far as I can see, first item of array is used to detect columns type:I think you could use
current($data)
function instead of$data[0]
so you get first element regardless the key name.