forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MDL-81044-main' of https://github.com/andrewnicols/moodle
- Loading branch information
Showing
3 changed files
with
25 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,19 +14,18 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
namespace core\hook\backup; | ||
namespace core_backup\hook; | ||
|
||
use core\hook\described_hook; | ||
|
||
/** | ||
* Get a list of event names which are excluded to trigger from course changes in automated backup. | ||
* | ||
* @package core | ||
* @package core_backup | ||
* @copyright 2023 Tomo Tsuyuki <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
final class get_excluded_events implements described_hook { | ||
|
||
final class before_course_modified_check implements described_hook { | ||
/** | ||
* @var string[] Array of event names. | ||
*/ | ||
|
@@ -52,13 +51,10 @@ public static function get_hook_tags(): array { | |
|
||
/** | ||
* Add an array of event names which are excluded to trigger from course changes in automated backup. | ||
* This is set from plugin hook. | ||
* e.g. ['\local_course\event\update', '\local_course\event\sync'] | ||
* | ||
* @param string[] $events Array of event name strings | ||
* @return void | ||
* @param string $events,... Array of event name strings | ||
*/ | ||
public function add_events(array $events): void { | ||
public function exclude_events(string ...$events): void { | ||
$this->events = array_merge($this->events, $events); | ||
} | ||
|
||
|
@@ -68,7 +64,7 @@ public function add_events(array $events): void { | |
* | ||
* @return array | ||
*/ | ||
public function get_events(): array { | ||
public function get_excluded_events(): array { | ||
return $this->events; | ||
} | ||
} |