original_string: public static function update_competency($record) {
          static::require_enabled();
          $competency = new competency($record->id);
  
          // First we do a permissions check.
          require_capability('moodle/competency:competencymanage', $competency->get_context());
  
          // Some things should not be changed in an update - they should use a more specific method.
          $record->sortorder = $competency->get('sortorder');
          $record->parentid = $competency->get('parentid');
          $record->competencyframeworkid = $competency->get('competencyframeworkid');
  
          $competency->from_record($record);
          require_capability('moodle/competency:competencymanage', $competency->get_context());
  
          // OK - all set.
          $result = $competency->update();
  
          // Trigger the update event.
          \core\event\competency_updated::create_from_competency($competency)->trigger();
  
          return $result;
      }
code: public static function update_competency($record) {
          static::require_enabled();
          $competency = new competency($record->id);
  
          // First we do a permissions check.
          require_capability('moodle/competency:competencymanage', $competency->get_context());
  
          // Some things should not be changed in an update - they should use a more specific method.
          $record->sortorder = $competency->get('sortorder');
          $record->parentid = $competency->get('parentid');
          $record->competencyframeworkid = $competency->get('competencyframeworkid');
  
          $competency->from_record($record);
          require_capability('moodle/competency:competencymanage', $competency->get_context());
  
          // OK - all set.
          $result = $competency->update();
  
          // Trigger the update event.
          \core\event\competency_updated::create_from_competency($competency)->trigger();
  
          return $result;
      }
code_tokens: public static function update_competency ( $ record ) { static :: require_enabled ( ) ; $ competency = new competency ( $ record -> id ) ; // First we do a permissions check. require_capability ( 'moodle/competency:competencymanage' , $ competency -> get_context ( ) ) ; // Some things should not be changed in an update - they should use a more specific method. $ record -> sortorder = $ competency -> get ( 'sortorder' ) ; $ record -> parentid = $ competency -> get ( 'parentid' ) ; $ record -> competencyframeworkid = $ competency -> get ( 'competencyframeworkid' ) ; $ competency -> from_record ( $ record ) ; require_capability ( 'moodle/competency:competencymanage' , $ competency -> get_context ( ) ) ; // OK - all set. $ result = $ competency -> update ( ) ; // Trigger the update event. \ core \ event \ competency_updated :: create_from_competency ( $ competency ) -> trigger ( ) ; return $ result ; }
docstring: Update the details for a competency.
  
  Requires moodle/competency:competencymanage capability at the system context.
  
  @param stdClass $record The new details for the competency.
  Note - must contain an id that points to the competency to update.
  
  @return boolean
docstring_tokens: Update the details for a competency .