3 // This file is part of Moodle - http://moodle.org/
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
20 * @subpackage backup-structure
21 * @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 * TODO: Finish phpdocs
28 * Abstract class representing the required implementation for classes able to process structure classes
30 abstract class base_processor
{
32 abstract function pre_process_nested_element(base_nested_element
$nested);
33 abstract function process_nested_element(base_nested_element
$nested);
34 abstract function post_process_nested_element(base_nested_element
$nested);
36 abstract function process_final_element(base_final_element
$final);
38 abstract function process_attribute(base_attribute
$attribute);
42 * base_processor abstract exception class
44 * This exceptions will be used by all the processor classes
45 * in order to detect any problem or miss-configuration
47 abstract class base_processor_exception
extends moodle_exception
{
50 * Constructor - instantiates one base_processor_exception.
52 * @param string $errorcode key for the corresponding error string
53 * @param object $a extra words and phrases that might be required in the error string
54 * @param string $debuginfo optional debugging information
56 public function __construct($errorcode, $a = null, $debuginfo = null) {
57 parent
::__construct($errorcode, '', '', $a, $debuginfo);