Passed
Push — master ( bc8b6f...7a9b1f )
by Sergei
02:57
created

Dossier   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 16
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getEmployeeQuery() 0 9 1
A getTableName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord;
6
7
use Yiisoft\ActiveRecord\ActiveQuery;
8
use Yiisoft\ActiveRecord\Tests\Stubs\MagicActiveRecord;
9
10
/**
11
 * Class Dossier
12
 *
13
 * @property int $id
14
 * @property int $department_id
15
 * @property int $employee_id
16
 * @property string $summary
17
 * @property Employee $employee
18
 */
19
final class Dossier extends MagicActiveRecord
20
{
21
    public function getTableName(): string
22
    {
23
        return 'dossier';
24
    }
25
26
    public function getEmployeeQuery(): ActiveQuery
27
    {
28
        return $this->hasOne(
29
            Employee::class,
30
            [
31
                'department_id' => 'department_id',
32
                'id' => 'employee_id',
33
            ]
34
        )->inverseOf('dossier');
35
    }
36
}
37