public function offsetGet($offset)
    {
        if (!isset($this[$offset])) {
            throw new OutOfBoundsException(
                sprintf('Index %s is out of bounds.', $offset)
            );
        }

        if ($this->index_field === null) {
            return $this->objects[$offset];
        }

        return $this->objects_by_index[$offset];
    }