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

Dossier::getEmployeeQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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