Moodle  2.2.1
http://www.collinsharper.com
restore_decode_rule Class Reference
Inheritance diagram for restore_decode_rule:

Public Member Functions

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

Protected Member Functions

 get_mapping ($itemname, $itemid)
 apply_modifications ($toreplace, $mappingsok)
 validate_params ($linkname, $urltemplate, $mappings)
 get_calculated_regexp ()

Protected Attributes

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

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

Definition at line 36 of file restore_decode_rule.class.php.


Constructor & Destructor Documentation

__construct ( linkname,
urltemplate,
mappings 
)

Definition at line 47 of file restore_decode_rule.class.php.

Here is the call graph for this function:


Member Function Documentation

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)

Reimplemented in mock_restore_decode_rule.

Definition at line 126 of file restore_decode_rule.class.php.

Here is the caller graph for this function:

decode ( content)

Definition at line 67 of file restore_decode_rule.class.php.

Here is the call graph for this function:

get_calculated_regexp ( ) [protected]

based on rule definition, build the regular expression to execute on decode

Reimplemented in mock_restore_decode_rule.

Definition at line 177 of file restore_decode_rule.class.php.

Here is the caller graph for this function:

get_mapping ( itemname,
itemid 
) [protected]

Looks for mapping values in backup_ids table, simple wrapper over get_backup_ids_record

Reimplemented in mock_restore_decode_rule.

Definition at line 110 of file restore_decode_rule.class.php.

Here is the call graph for this function:

Here is the caller graph for this function:

set_restoreid ( restoreid)

Definition at line 58 of file restore_decode_rule.class.php.

set_wwwroots ( sourcewwwroot,
targetwwwroot 
)

Definition at line 62 of file restore_decode_rule.class.php.

validate_params ( linkname,
urltemplate,
mappings 
) [protected]

Perform all the validations and checks on the rule attributes

Definition at line 137 of file restore_decode_rule.class.php.

Here is the caller graph for this function:


Field Documentation

$cregexp [protected]

Definition at line 45 of file restore_decode_rule.class.php.

$linkname [protected]

Definition at line 38 of file restore_decode_rule.class.php.

$mappings [protected]

Definition at line 40 of file restore_decode_rule.class.php.

$restoreid [protected]

Definition at line 41 of file restore_decode_rule.class.php.

$sourcewwwroot [protected]

Definition at line 42 of file restore_decode_rule.class.php.

$targetwwwroot [protected]

Definition at line 43 of file restore_decode_rule.class.php.

$urltemplate [protected]

Definition at line 39 of file restore_decode_rule.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations