aboutsummaryrefslogtreecommitdiff
path: root/lib/models/Courseware/Certificate.php
blob: d0c9fd9a5e11bccc1857047ffe8eb915de04c4f7 (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
<?php

namespace Courseware;

use \User, \Course;

/**
 * Courseware's certificates.
 *
 * @author  Thomas Hackl <hackl@data-quest.de>
 * @license GPL2 or any later version
 *
 * @since   Stud.IP 5.3
 *
 * @property string     $id             database column
 * @property string     $user_id        database column
 * @property string     $course_id      database column
 * @property int        $mkdate         database column
 */
class Certificate extends \SimpleORMap
{
    protected static function configure($config = [])
    {
        $config['db_table'] = 'cw_certificates';

        $config['belongs_to']['user'] = [
            'class_name' => User::class,
            'foreign_key' => 'user_id',
        ];

        $config['belongs_to']['course'] = [
            'class_name' => Course::class,
            'foreign_key' => 'course_id',
        ];

        parent::configure($config);
    }

}