Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.
   1  <?php
   2  
   3  // This file is part of Moodle - http://moodle.org/
   4  //
   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.
   9  //
  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.
  14  //
  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/>.
  17  
  18  /**
  19   * @package    moodlecore
  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
  23   *
  24   * TODO: Finish phpdocs
  25   */
  26  
  27  /**
  28   * Abstract class representing the required implementation for classes able to process structure classes
  29   */
  30  abstract class base_processor {
  31  
  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);
  35  
  36      abstract function process_final_element(base_final_element $final);
  37  
  38      abstract function process_attribute(base_attribute $attribute);
  39  }
  40  
  41  /**
  42   * base_processor abstract exception class
  43   *
  44   * This exceptions will be used by all the processor classes
  45   * in order to detect any problem or miss-configuration
  46   */
  47  abstract class base_processor_exception extends moodle_exception {
  48  
  49      /**
  50       * Constructor - instantiates one base_processor_exception.
  51       *
  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
  55       */
  56      public function __construct($errorcode, $a = null, $debuginfo = null) {
  57          parent::__construct($errorcode, '', '', $a, $debuginfo);
  58      }
  59  }