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;
    }
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;
    }
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 ; }
Create a new competency framework

@param array $competencyframework A single param with all the fields for a competency framework.
@return \stdClass The new record
Create a new competency framework