Product::getSku()   A
last analyzed

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 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace SlayerBirden\DFCodeGeneration\Catalog\Entities;
5
6
use Doctrine\ORM\Mapping as ORM;
7
8
/**
9
 * @ORM\Entity @ORM\Table(name="products")
10
 **/
11
class Product
12
{
13
    /**
14
     * @ORM\Id @ORM\Column(type="integer") @ORM\GeneratedValue
15
     * @var integer|null
16
     **/
17
    private $id;
18
    /**
19
     * @ORM\Column(type="string")
20
     * @var string
21
     **/
22
    private $name;
23
    /**
24
     * @ORM\Column(type="string", unique=true)
25
     * @var string
26
     **/
27
    private $sku;
28
    /**
29
     * @ORM\Column(type="string", nullable=true)
30
     * @var string
31
     **/
32
    private $title;
33
    /**
34
     * @ORM\ManyToMany(targetEntity="\SlayerBirden\DFCodeGeneration\Catalog\Entities\Category")
35
     * @var Category[]
36
     */
37
    private $categories;
38
    /**
39
     * @ORM\OneToOne(targetEntity="\SlayerBirden\DFCodeGeneration\Catalog\Entities\Stock")
40
     * @ORM\JoinColumn(nullable=false)
41
     * @var Stock
42
     */
43
    private $stock;
44
45
    /**
46
     * @return int|null
47
     */
48
    public function getId(): ?int
49
    {
50
        return $this->id;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getName(): string
57
    {
58
        return $this->name;
59
    }
60
61
    /**
62
     * @param string $name
63
     */
64
    public function setName(string $name): void
65
    {
66
        $this->name = $name;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getTitle(): string
73
    {
74
        return $this->title;
75
    }
76
77
    /**
78
     * @param string $title
79
     */
80
    public function setTitle(string $title): void
81
    {
82
        $this->title = $title;
83
    }
84
85
    /**
86
     * @return string
87
     */
88
    public function getSku(): string
89
    {
90
        return $this->sku;
91
    }
92
93
    /**
94
     * @param string $sku
95
     */
96
    public function setSku(string $sku): void
97
    {
98
        $this->sku = $sku;
99
    }
100
101
    /**
102
     * @return Stock
103
     */
104
    public function getStock(): Stock
105
    {
106
        return $this->stock;
107
    }
108
109
    /**
110
     * @param Stock $stock
111
     */
112
    public function setStock(Stock $stock): void
113
    {
114
        $this->stock = $stock;
115
    }
116
117
    /**
118
     * @return Category[]
119
     */
120
    public function getCategories(): array
121
    {
122
        return $this->categories;
123
    }
124
125
    /**
126
     * @param Category[] $categories
127
     */
128
    public function setCategories(array $categories): void
129
    {
130
        $this->categories = $categories;
131
    }
132
}
133