Completed
Pull Request — master (#10)
by Mariusz
03:23
created

Variant::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Xsolve\LegacyAssociateTests\Functional\DoctrineOrm\Mock\Entity;
4
5
use Doctrine\ORM\Mapping\Entity;
6
use Doctrine\ORM\Mapping\Table;
7
use Doctrine\ORM\Mapping\Id;
8
use Doctrine\ORM\Mapping\Column;
9
use Doctrine\ORM\Mapping\ManyToOne;
10
11
/**
12
 * @Entity
13
 * @Table(name="variant")
14
 */
15
class Variant
16
{
17
    /**
18
     * @var string
19
     *
20
     * @Id
21
     * @Column(type="string", length=64)
22
     */
23
    protected $id;
24
25
    /**
26
     * @var int
27
     *
28
     * @Column(type="integer")
29
     */
30
    protected $price;
31
32
    /**
33
     * @var Product
34
     *
35
     * @ManyToOne(targetEntity="Product", inversedBy="products")
36
     */
37
    protected $product;
38
39
    /**
40
     * @param string $id
41
     */
42
    public function __construct(string $id)
43
    {
44
        $this->id = $id;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getId(): string
51
    {
52
        return $this->id;
53
    }
54
55
    /**
56
     * @param int $price
57
     */
58
    public function setPrice(int $price)
59
    {
60
        $this->price = $price;
61
    }
62
63
    /**
64
     * @return int
65
     */
66
    public function getPrice(): int
67
    {
68
        return $this->price;
69
    }
70
71
    /**
72
     * @param Product $product
73
     */
74
    public function setProduct(Product $product)
75
    {
76
        $this->product = $product;
77
    }
78
79
    /**
80
     * @return Product
81
     */
82
    public function getProduct(): Product
83
    {
84
        return $this->product;
85
    }
86
}
87