public static function update_endpoint($data) {
        require_capability('moodle/site:config', context_system::instance());
        $endpoint = new endpoint(0, $data);

        // Will throw exceptions on validation failures.
        $endpoint->update();

        return $endpoint;
    }
public static function update_endpoint($data) {
        require_capability('moodle/site:config', context_system::instance());
        $endpoint = new endpoint(0, $data);

        // Will throw exceptions on validation failures.
        $endpoint->update();

        return $endpoint;
    }
public static function update_endpoint ( $ data ) { require_capability ( 'moodle/site:config' , context_system :: instance ( ) ) ; $ endpoint = new endpoint ( 0 , $ data ) ; // Will throw exceptions on validation failures. $ endpoint -> update ( ) ; return $ endpoint ; }
Take the data from the mform and update the endpoint.

@param stdClass $data
@return \core\oauth2\endpoint
Take the data from the mform and update the endpoint .