Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
moodle1_inforef_manager Class Reference

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.
 
 add_ref ($item, $id)
 Adds a reference.
 
 add_refs ($item, array $ids)
 Adds a bulk of references.
 
 write_refs (xml_writer $xmlwriter)
 Writes the current references using a given opened xml writer.
 

Protected Member Functions

 validate_item ($item)
 Makes sure that the given name is a valid citizen of inforef.xml file.
 

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
 

Detailed Description

Helper class that handles ids annotations for inforef.xml files.

Constructor & Destructor Documentation

◆ __construct()

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.

Parameters
moodle1_converter$converter
string$namethe name of the annotator (like course, section, activity, block)
int$idthe id of the annotator if required

Member Function Documentation

◆ add_ref()

moodle1_inforef_manager::add_ref ( $item,
$id )

Adds a reference.

Parameters
string$itemthe name of referenced item (like user, file, scale, outcome or grade_item)
int$idthe value of the reference

◆ add_refs()

moodle1_inforef_manager::add_refs ( $item,
array $ids )

Adds a bulk of references.

Parameters
string$itemthe name of referenced item (like user, file, scale, outcome or grade_item)
array$idsthe list of referenced ids

◆ validate_item()

moodle1_inforef_manager::validate_item ( $item)
protected

Makes sure that the given name is a valid citizen of inforef.xml file.

See also
backup_helper\get_inforef_itemnames()
Parameters
string$itemthe name of reference (like user, file, scale, outcome or grade_item)
Exceptions
coding_exception

◆ write_refs()

moodle1_inforef_manager::write_refs ( xml_writer $xmlwriter)

Writes the current references using a given opened xml writer.

Parameters
xml_writer$xmlwriter

The documentation for this class was generated from the following file: