blob: d2072feea2e84cd19033d00a841973578e8e5aab (
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
|
<?php
namespace eTask;
use JSONArrayObject;
/**
* eTask conforming test task relation.
*
* @property array $id alias for pk
* @property int $test_id database column
* @property int $task_id database column
* @property int $position database column
* @property int $part database column
* @property float|null $points database column
* @property \JSONArrayObject $options database column
* @property int|null $mkdate database column
* @property int|null $chdate database column
* @property Test $test belongs_to Test
* @property Task $task belongs_to Task
*/
class TestTask extends \SimpleORMap
{
use ConfigureTrait;
/**
* @see SimpleORMap::configure
*/
protected static function configure($config = [])
{
$config['db_table'] = 'etask_test_tasks';
$config['relationTypes'] = self::configureClassNames($config);
$config['belongs_to']['test'] = [
'class_name' => $config['relationTypes']['Test'],
'foreign_key' => 'test_id'];
$config['belongs_to']['task'] = [
'class_name' => $config['relationTypes']['Task'],
'foreign_key' => 'task_id'];
$config['serialized_fields']['options'] = JSONArrayObject::class;
parent::configure($config);
}
}
|