protected function getColumnIndexByKey(int $index, string $error_message)
    {
        if ($index < 0) {
            throw new Exception($error_message);
        }

        if ([] === $this->header) {
            return $index;
        }

        $value = array_search($index, array_flip($this->header), true);
        if (false !== $value) {
            return $value;
        }

        throw new Exception(sprintf($error_message, $index));
    }
protected function getColumnIndexByKey(int $index, string $error_message)
    {
        if ($index < 0) {
            throw new Exception($error_message);
        }

        if ([] === $this->header) {
            return $index;
        }

        $value = array_search($index, array_flip($this->header), true);
        if (false !== $value) {
            return $value;
        }

        throw new Exception(sprintf($error_message, $index));
    }
protected function getColumnIndexByKey ( int $ index , string $ error_message ) { if ( $ index < 0 ) { throw new Exception ( $ error_message ) ; } if ( [ ] === $ this -> header ) { return $ index ; } $ value = array_search ( $ index , array_flip ( $ this -> header ) , true ) ; if ( false !== $ value ) { return $ value ; } throw new Exception ( sprintf ( $ error_message , $ index ) ) ; }
Returns the selected column name according to its offset.

@throws Exception if the field is invalid or not found

@return int|string
Returns the selected column name according to its offset .