public function fetchOne(int $nth_record = 0): array
    {
        if ($nth_record < 0) {
            throw new Exception(sprintf('%s() expects the submitted offset to be a positive integer or 0, %s given', __METHOD__, $nth_record));
        }

        $iterator = new LimitIterator($this->records, $nth_record, 1);
        $iterator->rewind();

        return (array) $iterator->current();
    }
public function fetchOne(int $nth_record = 0): array
    {
        if ($nth_record < 0) {
            throw new Exception(sprintf('%s() expects the submitted offset to be a positive integer or 0, %s given', __METHOD__, $nth_record));
        }

        $iterator = new LimitIterator($this->records, $nth_record, 1);
        $iterator->rewind();

        return (array) $iterator->current();
    }
public function fetchOne ( int $ nth_record = 0 ) : array { if ( $ nth_record < 0 ) { throw new Exception ( sprintf ( '%s() expects the submitted offset to be a positive integer or 0, %s given' , __METHOD__ , $ nth_record ) ) ; } $ iterator = new LimitIterator ( $ this -> records , $ nth_record , 1 ) ; $ iterator -> rewind ( ) ; return ( array ) $ iterator -> current ( ) ; }
Returns the nth record from the result set.

By default if no index is provided the first record of the resultet is returned

@param int $nth_record the CSV record offset

@throws Exception if argument is lesser than 0
Returns the nth record from the result set .