public function reindex()
    {
        if ($this->index_field !== null) {
            $this->objects_by_index = array();
            $index_field = $this->index_field;
            foreach ($this->objects as $object) {
                if (isset($object->$index_field)) {
                    $this->objects_by_index[$object->$index_field] = $object;
                }
            }
        }
    }