Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Helper class that handles ids annotations for inforef.xml files. More...
Public Member Functions | |
__construct (moodle1_converter $converter, $name, $id=0) | |
Creates new instance of the manager for the given annotator. More... | |
add_ref ($item, $id) | |
Adds a reference. More... | |
add_refs ($item, array $ids) | |
Adds a bulk of references. More... | |
write_refs (xml_writer $xmlwriter) | |
Writes the current references using a given opened xml writer. More... | |
Protected Member Functions | |
validate_item ($item) | |
Makes sure that the given name is a valid citizen of inforef.xml file. More... | |
Protected Attributes | |
string | $annotator = null |
the name of the annotator we serve to (like course, section, activity, block) | |
int | $annotatorid = null |
the id of the annotator if it can have multiple instances | |
Helper class that handles ids annotations for inforef.xml files.
moodle1_inforef_manager::__construct | ( | moodle1_converter | $converter, |
$name, | |||
$id = 0 |
|||
) |
Creates new instance of the manager for the given annotator.
The identification of the annotator we serve to may be important in the future when we move the actual storage of the references from memory to a persistent storage.
moodle1_converter | $converter | |
string | $name | the name of the annotator (like course, section, activity, block) |
int | $id | the id of the annotator if required |
moodle1_inforef_manager::add_ref | ( | $item, | |
$id | |||
) |
Adds a reference.
string | $item | the name of referenced item (like user, file, scale, outcome or grade_item) |
int | $id | the value of the reference |
moodle1_inforef_manager::add_refs | ( | $item, | |
array | $ids | ||
) |
Adds a bulk of references.
string | $item | the name of referenced item (like user, file, scale, outcome or grade_item) |
array | $ids | the list of referenced ids |
|
protected |
Makes sure that the given name is a valid citizen of inforef.xml file.
string | $item | the name of reference (like user, file, scale, outcome or grade_item) |
coding_exception |
moodle1_inforef_manager::write_refs | ( | xml_writer | $xmlwriter | ) |
Writes the current references using a given opened xml writer.
xml_writer | $xmlwriter |