Product::tableName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace yii2mod\cart\tests\data;
4
5
use yii\db\ActiveRecord;
6
use yii2mod\cart\models\CartItemInterface;
7
8
/**
9
 * Class Product
10
 *
11
 * @property int $id
12
 * @property string $name
13
 * @property string $price
14
 */
15
class Product extends ActiveRecord implements CartItemInterface
16
{
17
    /**
18
     * @return string
19
     */
20
    public static function tableName(): string
21
    {
22
        return 'product';
23
    }
24
25
    /**
26
     * @return int
27
     */
28
    public function getPrice(): int
29
    {
30
        return $this->price;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getLabel(): string
37
    {
38
        return $this->name;
39
    }
40
41
    /**
42
     * @return mixed
43
     */
44
    public function getUniqueId(): int
45
    {
46
        return $this->id;
47
    }
48
}
49