Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.
   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 core\event;
  18  
  19  defined('MOODLE_INTERNAL') || die();
  20  /**
  21   * Antivirus scan data error event
  22   *
  23   * @package    core
  24   * @author     Kevin Pham <kevinpham@catalyst-au.net>
  25   * @copyright  Catalyst IT, 2021
  26   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  27   */
  28  class antivirus_scan_data_error extends \core\event\base {
  29      /**
  30       * Event data
  31       */
  32      protected function init() {
  33          $this->data['crud'] = 'c';
  34          $this->data['edulevel'] = self::LEVEL_OTHER;
  35      }
  36  
  37      /**
  38       * Return event description
  39       *
  40       * @return string description
  41       * @throws \coding_exception
  42       */
  43      public function get_description() {
  44          if (isset($this->other['incidentdetails'])) {
  45              return format_text($this->other['incidentdetails'], FORMAT_MOODLE);
  46          } else {
  47              return get_string('dataerrordesc', 'antivirus');
  48          }
  49      }
  50  
  51      /**
  52       * Return event name
  53       *
  54       * @return string name
  55       * @throws \coding_exception
  56       */
  57      public static function get_name() {
  58          return get_string('dataerrorname', 'antivirus');
  59      }
  60  
  61      /**
  62       * Return event report link
  63       * @return \moodle_url
  64       * @throws \moodle_exception
  65       */
  66      public function get_url() {
  67          return new \moodle_url('/report/infectedfiles/index.php');
  68      }
  69  }