public static function enrol_instance_updated(\core\event\enrol_instance_updated $event) {
        global $DB;

        if (!enrol_is_enabled('meta')) {
            // This is slow, let enrol_meta_sync() deal with disabled plugin.
            return true;
        }

        // Does anything want to sync with this parent?
        $affectedcourses = $DB->get_fieldset_sql('SELECT DISTINCT courseid FROM {enrol} '.
                'WHERE customint1 = ? AND enrol = ?',
                array($event->courseid, 'meta'));

        foreach ($affectedcourses as $courseid) {
            enrol_meta_sync($courseid);
        }

        return true;
    }