public function key()
    {
        if (
            $this->index_field !== null &&
            isset($this->current()->{$this->index_field})
        ) {
            $key = $this->current()->{$this->index_field};
        } else {
            $key = $this->current_index;
        }

        return $key;
    }