Moodle  2.2.1
http://www.collinsharper.com
convert_path Class Reference

Public Member Functions

 __construct ($name, $path, array $recipe=array(), $grouped=false)
 set_processing_object ($pobject)
 set_processing_method ($pmethod)
 set_start_method ($smethod)
 set_end_method ($emethod)
 set_tags ($tags)
 set_dropped_fields (array $fields)
 set_renamed_fields (array $fields)
 set_new_fields (array $fields)
 apply_recipes (array $data)
 get_name ()
 get_path ()
 is_grouped ()
 get_processing_object ()
 get_processing_method ()
 get_start_method ()
 get_end_method ()
 get_tags ()

Protected Member Functions

the element given name

end of public API //////////////////////////////////////////////////////

Makes sure the given name is a valid element name

Note it may look as if we used exceptions for code flow control here. That's not the case as we actually validate the code, not the user data. And the code is supposed to be correct.

Parameters:
string
Exceptions:
convert_path_exception
Returns:
void
 validate_name ($name)
 validate_pobject ($pobject)

Protected Attributes

 $name
 $path
 $grouped
 $pobject = null
 $pmethod = null
 $smethod = null
 $emethod = null
 $tags = null
 $dropfields = array()
 $renamefields = array()
 $newfields = array()

Detailed Description

Class representing a path to be converted from XML file

This was created as a copy of restore_path_element and should be refactored probably.

Definition at line 816 of file lib.php.


Constructor & Destructor Documentation

__construct ( name,
path,
array recipe = array(),
grouped = false 
)

Constructor

Parameters:
string$namename of the element
string$pathpath of the element
array$recipebasic description of the structure conversion
bool$groupedto gather information in grouped mode or no

Definition at line 859 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

apply_recipes ( array data)

Cooks the parsed tags data by applying known recipes

Recipes are used for common trivial operations like adding new fields or renaming fields. The handler's processing method receives cooked data.

Parameters:
array$datathe contents of the element
Returns:
array

Definition at line 970 of file lib.php.

Here is the call graph for this function:

Returns:
string the name of the path end event listener

Definition at line 1052 of file lib.php.

Here is the caller graph for this function:

get_name ( )
Returns:
string the element given name

Definition at line 1010 of file lib.php.

get_path ( )
Returns:
string the path to the element

Definition at line 1017 of file lib.php.

Returns:
string the name of the method to call to process the element

Definition at line 1038 of file lib.php.

Here is the caller graph for this function:

Returns:
object the processing object providing the processing method

Definition at line 1031 of file lib.php.

Returns:
string the name of the path start event listener

Definition at line 1045 of file lib.php.

Here is the caller graph for this function:

get_tags ( )
Returns:
mixed the element data

Definition at line 1059 of file lib.php.

Returns:
bool flag to define if this element will get child ones grouped or no

Definition at line 1024 of file lib.php.

Here is the caller graph for this function:

set_dropped_fields ( array fields)

Sets the list of deprecated fields to drop

Parameters:
array$fields

Definition at line 938 of file lib.php.

Here is the caller graph for this function:

set_end_method ( emethod)

Sets the name of the path end event listener

Parameters:
string$emethod

Definition at line 920 of file lib.php.

Here is the caller graph for this function:

set_new_fields ( array fields)

Sets the new fields and their values

Parameters:
array$fields(string)$field => (mixed)value

Definition at line 956 of file lib.php.

Here is the caller graph for this function:

set_processing_method ( pmethod)

Sets the name of the processing method

Parameters:
string$pmethod

Definition at line 902 of file lib.php.

Here is the caller graph for this function:

set_processing_object ( pobject)

Validates and sets the given processing object

Parameters:
object$pobjectprocessing object, must provide a method to be called

Definition at line 892 of file lib.php.

Here is the call graph for this function:

set_renamed_fields ( array fields)

Sets the required new names of the current fields

Parameters:
array$fields(string)$currentname => (string)$newname

Definition at line 947 of file lib.php.

Here is the caller graph for this function:

set_start_method ( smethod)

Sets the name of the path start event listener

Parameters:
string$smethod

Definition at line 911 of file lib.php.

Here is the caller graph for this function:

set_tags ( tags)

Sets the element tags

Parameters:
array$tags

Definition at line 929 of file lib.php.

validate_name ( name) [protected]

Definition at line 1077 of file lib.php.

Here is the caller graph for this function:

validate_pobject ( pobject) [protected]

Makes sure that the given object is a valid processing object

The processing object must be an object providing at least element's processing method or path-reached-end event listener or path-reached-start listener method.

Note it may look as if we used exceptions for code flow control here. That's not the case as we actually validate the code, not the user data. And the code is supposed to be correct.

Parameters:
object$pobject
Exceptions:
convert_path_exception
Returns:
void

Definition at line 1104 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$dropfields = array() [protected]

Definition at line 843 of file lib.php.

$emethod = null [protected]

Definition at line 837 of file lib.php.

$grouped [protected]

Definition at line 825 of file lib.php.

$name [protected]

Definition at line 819 of file lib.php.

$newfields = array() [protected]

Definition at line 849 of file lib.php.

$path [protected]

Definition at line 822 of file lib.php.

$pmethod = null [protected]

Definition at line 831 of file lib.php.

$pobject = null [protected]

Definition at line 828 of file lib.php.

$renamefields = array() [protected]

Definition at line 846 of file lib.php.

$smethod = null [protected]

Definition at line 834 of file lib.php.

$tags = null [protected]

Definition at line 840 of file lib.php.


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