original_string: public static function create_competency_framework($competencyframework) {
          global $PAGE;
  
          $params = self::validate_parameters(self::create_competency_framework_parameters(), array(
              'competencyframework' => $competencyframework
          ));
          $params = $params['competencyframework'];
  
          $context = self::get_context_from_params($params);
          self::validate_context($context);
          $output = $PAGE->get_renderer('core');
  
          unset($params['contextlevel']);
          unset($params['instanceid']);
          $params['contextid'] = $context->id;
  
          $params = (object) $params;
          $result = api::create_framework($params);
          $exporter = new competency_framework_exporter($result);
          $record = $exporter->export($output);
          return $record;
      }
code: public static function create_competency_framework($competencyframework) {
          global $PAGE;
  
          $params = self::validate_parameters(self::create_competency_framework_parameters(), array(
              'competencyframework' => $competencyframework
          ));
          $params = $params['competencyframework'];
  
          $context = self::get_context_from_params($params);
          self::validate_context($context);
          $output = $PAGE->get_renderer('core');
  
          unset($params['contextlevel']);
          unset($params['instanceid']);
          $params['contextid'] = $context->id;
  
          $params = (object) $params;
          $result = api::create_framework($params);
          $exporter = new competency_framework_exporter($result);
          $record = $exporter->export($output);
          return $record;
      }
code_tokens: public static function create_competency_framework ( $ competencyframework ) { global $ PAGE ; $ params = self :: validate_parameters ( self :: create_competency_framework_parameters ( ) , array ( 'competencyframework' => $ competencyframework ) ) ; $ params = $ params [ 'competencyframework' ] ; $ context = self :: get_context_from_params ( $ params ) ; self :: validate_context ( $ context ) ; $ output = $ PAGE -> get_renderer ( 'core' ) ; unset ( $ params [ 'contextlevel' ] ) ; unset ( $ params [ 'instanceid' ] ) ; $ params [ 'contextid' ] = $ context -> id ; $ params = ( object ) $ params ; $ result = api :: create_framework ( $ params ) ; $ exporter = new competency_framework_exporter ( $ result ) ; $ record = $ exporter -> export ( $ output ) ; return $ record ; }
docstring: Create a new competency framework
  
  @param array $competencyframework A single param with all the fields for a competency framework.
  @return \stdClass The new record
docstring_tokens: Create a new competency framework