aboutsummaryrefslogtreecommitdiff
path: root/lib/models/calendar/CalendarDateException.php
blob: 1429ee435d92dadfe52b184c0d6bad02cb3f65a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
 * The CalendarDateException class represents one exception for a calendar date.
 *
 * This file is part of Stud.IP
 *
 * This program 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 2 of
 * the License, or (at your option) any later version.
 *
 * @author      Moritz Strohm <strohm@data-quest.de>
 * @copyright   2023
 * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
 * @category    Stud.IP
 * @package     resources
 * @since       5.5
 *
 * @property int $id The ID of the exception.
 * @property string $calendar_date_id The ID of the calendar date where the exception belongs to.
 * @property string $date The date of the exception in the date format YYYY-MM-DD.
 * @property int $mkdate The creation date of the exception.
 * @property int $chdate The modification date of the exception.
 * @property CalendarDate $calendar_date The associated calendar date object.
 */
class CalendarDateException extends SimpleORMap
{
    protected static function configure($config = [])
    {
        $config['db_table'] = 'calendar_date_exceptions';

        $config['belongs_to']['calendar_date'] = [
            'class_name' => CalendarDate::class,
            'foreign_key' => 'calendar_date_id',
            'assoc_func' => 'find'
        ];

        parent::configure($config);
    }
}