public function toArray()
    {
        $items = array();
        foreach ($this->items as $key => $item) {
            if (is_numeric($item)) {
                $item = DataObject::get_by_id($this->dataClass, $item);
            }
            if (!empty($this->extraFields[$key])) {
                $item->update($this->extraFields[$key]);
            }
            $items[] = $item;
        }
        return $items;
    }