Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
restore_decode_rule Class Reference

Helper class used to decode links back to their original form. More...

Public Member Functions

 __construct ($linkname, $urltemplate, $mappings)
 
 decode ($content)
 
 set_restoreid ($restoreid)
 
 set_wwwroots ($sourcewwwroot, $targetwwwroot)
 

Protected Member Functions

 apply_modifications ($toreplace, $mappingsok)
 Apply other modifications, based in the result of $mappingsok before placeholder replacements. More...
 
 get_calculated_regexp ()
 based on rule definition, build the regular expression to execute on decode
 
 get_mapping ($itemname, $itemid)
 Looks for mapping values in backup_ids table, simple wrapper over get_backup_ids_record.
 
 validate_params ($linkname, $urltemplate, $mappings)
 Perform all the validations and checks on the rule attributes.
 

Protected Attributes

 $cregexp
 
 $linkname
 
 $mappings
 
 $restoreid
 
 $sourcewwwroot
 
 $targetwwwroot
 
 $urltemplate
 

Detailed Description

Helper class used to decode links back to their original form.

This class allows each restore task to specify the changes that will be applied to any encoded (by backup) link to revert it back to its original form, recoding any parameter as needed.

TODO: Complete phpdocs

Member Function Documentation

◆ apply_modifications()

restore_decode_rule::apply_modifications (   $toreplace,
  $mappingsok 
)
protected

Apply other modifications, based in the result of $mappingsok before placeholder replacements.

Right now, simply prefix with the proper wwwroot (source/target)


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