original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Triggered via enrol_instance_updated event.
  
  @param \core\event\enrol_instance_updated $event
  @return boolean
docstring_tokens: Triggered via enrol_instance_updated event .