Total Complexity | 3 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | abstract class WorkLog extends \roaresearch\yii2\rmdb\migrations\CreatePivot |
||
9 | { |
||
10 | /** |
||
11 | * @var string suffix attached at the end of the process table. |
||
12 | */ |
||
13 | public $worklogSuffix = '_worklog'; |
||
14 | |||
15 | /** |
||
16 | * @return string name of the table to which the worklog will be attached. |
||
17 | */ |
||
18 | abstract public function getProcessTableName(): string; |
||
19 | |||
20 | /** |
||
21 | * @inhertidoc |
||
22 | */ |
||
23 | public function getTableName(): string |
||
24 | { |
||
25 | return $this->getProcessTableName() . $this->worklogSuffix; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @inhertidoc |
||
30 | */ |
||
31 | public function columns(): array |
||
32 | { |
||
33 | return [ |
||
34 | 'id' => $this->primaryKey(), |
||
35 | 'process_id' => $this->normalKey(), |
||
36 | 'stage_id' => $this->normalKey(), |
||
37 | 'comment' => $this->text(), |
||
38 | ]; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @inhertidoc |
||
43 | */ |
||
44 | public function foreignKeys(): array |
||
49 | ]; |
||
50 | } |
||
51 | } |
||
52 |