public function delete_service($serviceid) {
        global $DB;
        $DB->delete_records('external_services_users', array('externalserviceid' => $serviceid));
        $DB->delete_records('external_services_functions', array('externalserviceid' => $serviceid));
        $DB->delete_records('external_tokens', array('externalserviceid' => $serviceid));
        $DB->delete_records('external_services', array('id' => $serviceid));
    }
public function delete_service($serviceid) {
        global $DB;
        $DB->delete_records('external_services_users', array('externalserviceid' => $serviceid));
        $DB->delete_records('external_services_functions', array('externalserviceid' => $serviceid));
        $DB->delete_records('external_tokens', array('externalserviceid' => $serviceid));
        $DB->delete_records('external_services', array('id' => $serviceid));
    }
public function delete_service ( $ serviceid ) { global $ DB ; $ DB -> delete_records ( 'external_services_users' , array ( 'externalserviceid' => $ serviceid ) ) ; $ DB -> delete_records ( 'external_services_functions' , array ( 'externalserviceid' => $ serviceid ) ) ; $ DB -> delete_records ( 'external_tokens' , array ( 'externalserviceid' => $ serviceid ) ) ; $ DB -> delete_records ( 'external_services' , array ( 'id' => $ serviceid ) ) ; }
Delete a service
Also delete function references and authorised user references.

@param int $serviceid service id
Delete a service Also delete function references and authorised user references .