Commit | Line | Data |
---|---|---|
b5d45a04 EL |
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-plan | |
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 | ||
25 | /** | |
26 | * Abstract class defining the needed stuf for one restore task (a collection of steps) | |
27 | * | |
28 | * TODO: Finish phpdocs | |
29 | */ | |
30 | abstract class restore_task extends base_task { | |
31 | ||
32 | /** | |
33 | * Constructor - instantiates one object of this class | |
34 | */ | |
35 | public function __construct($name, $plan = null) { | |
36 | if (!is_null($plan) && !($plan instanceof restore_plan)) { | |
37 | throw new restore_task_exception('wrong_restore_plan_specified'); | |
38 | } | |
39 | parent::__construct($name, $plan); | |
40 | } | |
41 | ||
42 | public function get_restoreid() { | |
43 | return $this->plan->get_restoreid(); | |
44 | } | |
c9d8234a EL |
45 | |
46 | public function get_info() { | |
47 | return $this->plan->get_info(); | |
48 | } | |
a4e13312 EL |
49 | |
50 | public function get_target() { | |
51 | return $this->plan->get_target(); | |
52 | } | |
b5d45a04 EL |
53 | } |
54 | ||
55 | /* | |
56 | * Exception class used by all the @restore_task stuff | |
57 | */ | |
58 | class restore_task_exception extends base_task_exception { | |
59 | ||
60 | public function __construct($errorcode, $a=NULL, $debuginfo=null) { | |
61 | parent::__construct($errorcode, $a, $debuginfo); | |
62 | } | |
63 | } |