Commit 4ef0f57d authored by Dan Poltawski's avatar Dan Poltawski
Browse files

Merge branch 'MDL-49560-28' of git://github.com/gurgus/moodle into MOODLE_28_STABLE

parents d88c3438 421f7270
......@@ -273,11 +273,6 @@ class webservice_soap_server extends webservice_zend_server {
*/
protected function generate_simple_struct_class(external_single_structure $structdesc) {
global $USER;
// let's use unique class name, there might be problem in unit tests
$classname = 'webservices_struct_class_000000';
while(class_exists($classname)) {
$classname++;
}
$fields = array();
foreach ($structdesc->keys as $name => $fieldsdesc) {
......@@ -286,6 +281,12 @@ class webservice_soap_server extends webservice_zend_server {
' public $'.$name.';';
}
// We do this after the call to get_phpdoc_type() to avoid duplicate class creation.
$classname = 'webservices_struct_class_000000';
while (class_exists($classname)) {
$classname++;
}
$code = '
/**
* Virtual struct class for web services for user id '.$USER->id.' in context '.$this->restricted_context->id.'.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment