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

CustomerWithConstructor::getTableName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
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
use Yiisoft\Aliases\Aliases;
10
use Yiisoft\Db\Connection\ConnectionInterface;
11
12
/**
13
 * CustomerWithConstructor.
14
 *
15
 * @property int $id
16
 * @property string $name
17
 * @property string $email
18
 * @property string $address
19
 * @property int $status
20
 * @property ProfileWithConstructor $profile
21
 */
22
final class CustomerWithConstructor extends MagicActiveRecord
23
{
24
    public function __construct(ConnectionInterface $db, private Aliases $aliases)
25
    {
26
        parent::__construct($db);
27
    }
28
29
    public function getTableName(): string
30
    {
31
        return 'customer';
32
    }
33
34
    public function getProfileQuery(): ActiveQuery
35
    {
36
        return $this->hasOne(Profile::class, ['id' => 'profile_id']);
37
    }
38
}
39