• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

apsolu / enrol_select / 18468989541

13 Oct 2025 02:26PM UTC coverage: 13.78% (-0.05%) from 13.833%
18468989541

push

github

jboulen
fixup

0 of 6 new or added lines in 2 files covered. (0.0%)

144 of 1045 relevant lines covered (13.78%)

0.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/classes/event/batch_enrol_instance_updated.php
1
<?php
2
// This file is part of Moodle - http://moodle.org/
3
//
4
// Moodle is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// Moodle is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16

17
namespace enrol_select\event;
18

19
/**
20
 * Enregistre une trace lorsque des méthodes d'inscription sont mis à jour en lot.
21
 *
22
 * @package    enrol_select
23
 * @copyright  2025 Université Rennes 2 <dsi-contact@univ-rennes2.fr>
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 */
26
class batch_enrol_instance_updated extends \core\event\base {
27
    /**
28
     * Initialise l'évènement.
29
     *
30
     * @return void
31
     */
32
    protected function init() {
33
        // Values: c (create), r (read), u (update) or d (delete).
34
        $this->data['crud'] = 'u';
×
35

36
        // Values: LEVEL_TEACHING, LEVEL_PARTICIPATING or LEVEL_OTHER.
37
        $this->data['edulevel'] = self::LEVEL_OTHER;
×
38
    }
39

40
    /**
41
     * Retourne le nom de l'évènement.
42
     *
43
     * @return string
44
     */
45
    public static function get_name() {
46
        return get_string('batch_enrol_instance_updated', 'local_apsolu');
×
47
    }
48

49
    /**
50
     * Retourne les critères utilisés pour la mise à jour des méthodes d'inscription.
51
     *
52
     * @return string
53
     */
54
    public function get_critiria() {
55
        $criteria = [];
×
56
        foreach ($this->other['criteria'] as $field => $id) {
×
57
            $criteria[] = $field . ' with id ' . $id;
×
58
        }
59
        return implode(', ', $criteria);
×
60
    }
61

62
    /**
63
     * Retourne la description de l'évènement.
64
     *
65
     * @return string
66
     */
67
    public function get_description() {
NEW
68
        return "The user with id '$this->userid' updated all enrol instances with following criteria : " .
×
NEW
69
            $this->get_criteria() . ".";
×
70
    }
71

72
    /**
73
     * Retourne l'URL liée à l'action.
74
     *
75
     * @return \moodle_url
76
     */
77
    public function get_url() {
78
        return new \moodle_url('/enrol/select/administration.php', ['tab' => 'batch_settings']);
×
79
    }
80

81
    /**
82
     * Valide les données.
83
     *
84
     * Throw \coding_exception notice in case of any problems.
85
     */
86
    protected function validate_data() {
87
        parent::validate_data();
×
88

89
        if (isset($this->other['criteria']) === false || is_array($this->other['criteria']) === false) {
×
90
            throw new \coding_exception('The array \'criteria\' value must be set in other.');
×
91
        }
92
    }
93
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc