original_string: public function add_external_function_to_service($functionname, $serviceid) {
          global $DB;
          $addedfunction = new stdClass();
          $addedfunction->externalserviceid = $serviceid;
          $addedfunction->functionname = $functionname;
          $DB->insert_record('external_services_functions', $addedfunction);
      }
code: public function add_external_function_to_service($functionname, $serviceid) {
          global $DB;
          $addedfunction = new stdClass();
          $addedfunction->externalserviceid = $serviceid;
          $addedfunction->functionname = $functionname;
          $DB->insert_record('external_services_functions', $addedfunction);
      }
code_tokens: public function add_external_function_to_service ( $ functionname , $ serviceid ) { global $ DB ; $ addedfunction = new stdClass ( ) ; $ addedfunction -> externalserviceid = $ serviceid ; $ addedfunction -> functionname = $ functionname ; $ DB -> insert_record ( 'external_services_functions' , $ addedfunction ) ; }
docstring: Add a function to a service
  
  @param string $functionname function name
  @param int $serviceid service id
docstring_tokens: Add a function to a service