Esempio n. 1
0
 /**
  * Update the details for a competency framework.
  *
  * Requires moodle/competency:competencymanage capability at the system context.
  *
  * @param stdClass $record The new details for the framework. Note - must contain an id that points to the framework to update.
  * @return boolean
  */
 public static function update_framework($record)
 {
     static::require_enabled();
     $framework = new competency_framework($record->id);
     // Check the permissions before update.
     require_capability('moodle/competency:competencymanage', $framework->get_context());
     // Account for different formats of taxonomies.
     $framework->from_record($record);
     if (isset($record->taxonomies)) {
         $framework->set_taxonomies($record->taxonomies);
     }
     // Trigger a competency framework updated event.
     \core\event\competency_framework_updated::create_from_framework($framework)->trigger();
     return $framework->update();
 }