Total Complexity | 11 |
Total Lines | 81 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class Variant |
||
14 | { |
||
15 | /** |
||
16 | * @ORM\Id |
||
17 | * @ORM\GeneratedValue |
||
18 | * @ORM\Column(type="integer") |
||
19 | */ |
||
20 | private $id; |
||
21 | |||
22 | /** |
||
23 | * @ORM\Column(type="integer", nullable=true) |
||
24 | */ |
||
25 | private $prePersistedId; |
||
26 | |||
27 | /** |
||
28 | * @ORM\Column(type="string", length=255) |
||
29 | */ |
||
30 | private $name; |
||
31 | |||
32 | /** |
||
33 | * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="variants") |
||
34 | */ |
||
35 | private $product; |
||
36 | |||
37 | /** |
||
38 | * @ORM\OneToOne(targetEntity=Image::class, cascade={"persist"}) |
||
39 | */ |
||
40 | private $image; |
||
41 | |||
42 | public function getId(): ?int |
||
43 | { |
||
44 | return $this->id; |
||
45 | } |
||
46 | |||
47 | public function getPrePersistedId(): ?int |
||
48 | { |
||
49 | return $this->prePersistedId; |
||
50 | } |
||
51 | |||
52 | public function setPrePersistedId(?int $prePersistedId): void |
||
53 | { |
||
54 | $this->prePersistedId = $prePersistedId; |
||
55 | } |
||
56 | |||
57 | public function getName(): ?string |
||
60 | } |
||
61 | |||
62 | public function setName(?string $name): void |
||
63 | { |
||
64 | $this->name = $name; |
||
65 | } |
||
66 | |||
67 | public function getProduct(): ?Product |
||
68 | { |
||
69 | return $this->product; |
||
70 | } |
||
71 | |||
72 | public function setProduct(Product $product): void |
||
73 | { |
||
74 | $this->product = $product; |
||
75 | } |
||
76 | |||
77 | public function getImage(): ?Image |
||
78 | { |
||
79 | return $this->image; |
||
80 | } |
||
81 | |||
82 | public function setImage(Image $image): void |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * @ORM\PrePersist |
||
89 | */ |
||
90 | public function generatePrePersist() |
||
94 | } |
||
95 | } |
||
96 | } |
||
97 |