<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

namespace local_kid\event;

defined('MOODLE_INTERNAL') || die();

class promotion_updated extends \core\event\base {

    protected function init() {
        $this->data['crud'] = 'u';
        $this->data['edulevel'] = self::LEVEL_OTHER;
        $this->data['objecttable'] = 'local_kid_promotion';
    }

    public static function get_name() {
        return get_string('event_promotion_updated', 'local_kid');
    }

    public function get_description() {
        $action = $this->other['action'] ?? 'updated';
        return "The user with id '{$this->userid}' {$action} the promotion with id '{$this->objectid}'.";
    }

    public function get_url() {
        return new \moodle_url('/local/kid/pages/admin.php', ['tab' => 'promotions']);
    }
}
