blob: dc7a7187b0a4d0c0e52a0bf75b46d9ff2316aa5d (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<?php
/**
* ExternPageConfig.php - model class for the configuration of external pages
*
* 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 Peter Thienel <thienel@data-quest.de>
* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
* @category Stud.IP
* @package extern
* @since 5.4
*
* @property string $id alias column for config_id
* @property string $config_id database column
* @property string $range_id database column
* @property string $type database column
* @property string $name database column
* @property string $description database column
* @property JSONArrayObject $conf database column
* @property string $template database column
* @property string $author_id database column
* @property string $editor_id database column
* @property int $mkdate database column
* @property int $chdate database column
* @property User $author belongs_to User
* @property User $editor belongs_to User
* @property Institute $range belongs_to Institute
*/
class ExternPageConfig extends SimpleORMap
{
/**
* Configures this model.
*
* @param array $config Configuration array
*/
protected static function configure($config = [])
{
$config['db_table'] = 'extern_pages_configs';
$config['belongs_to']['author'] = [
'class_name' => User::class,
'foreign_key' => 'author_id'
];
$config['belongs_to']['editor'] = [
'class_name' => User::class,
'foreign_key' => 'editor_id'
];
$config['belongs_to']['range'] = [
'class_name' => Institute::class,
'foreign_key' => 'range_id'
];
$config['serialized_fields']['conf'] = JSONArrayObject::class;
parent::configure($config);
}
}
|