Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 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 factor_sms\event;
18
 
19
/**
20
 * Event for a sent SMS
21
 *
22
 * @package     factor_sms
23
 * @author      Alex Morris <alex.morris@catalyst.net.nz>
24
 * @copyright   Catalyst IT
25
 * @license     http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
 */
27
class sms_sent extends \core\event\base {
28
 
29
    /**
30
     * Init sms sent event
31
     */
32
    protected function init() {
33
        $this->data['crud'] = 'r';
34
        $this->data['edulevel'] = self::LEVEL_OTHER;
35
    }
36
 
37
    /**
38
     * Returns non-localised event description with id's for admin use only.
39
     *
40
     * @return string
41
     */
42
    public function get_description(): string {
43
 
44
        $content = [
45
            'userid' => $this->other['userid'],
46
            'debuginfo' => is_array($this->other['debug']) ? json_encode($this->other['debug']) : $this->other['debug'],
47
        ];
48
 
49
        return get_string('event:smssentdescription', 'factor_sms', $content);
50
    }
51
 
52
    /**
53
     * Returns localised general event name.
54
     *
55
     * Override in subclass, we can not make it static and abstract at the same time.
56
     *
57
     * @return string
58
     */
59
    public static function get_name(): string {
60
        return get_string('event:smssent', 'factor_sms');
61
    }
62
}