public function register_dependency(setting_dependency $dependency) {
        if ($this->is_circular_reference($dependency->get_dependent_setting())) {
            $a = new stdclass();
            $a->alreadydependent = $this->name;
            $a->main = $dependency->get_dependent_setting()->get_name();
            throw new base_setting_exception('setting_circular_reference', $a);
        }
        $this->dependencies[$dependency->get_dependent_setting()->get_name()] = $dependency;
        $dependency->get_dependent_setting()->register_dependent_dependency($dependency);
    }