public static function remove_related_competency($competencyid, $relatedcompetencyid) {
        static::require_enabled();
        $competency = new competency($competencyid);

        // This only check if we have the permission in either competency because both competencies
        // should belong to the same framework.
        require_capability('moodle/competency:competencymanage', $competency->get_context());

        $relatedcompetency = related_competency::get_relation($competencyid, $relatedcompetencyid);
        if ($relatedcompetency->get('id')) {
            return $relatedcompetency->delete();
        }

        return false;
    }