| 1 | <?php |
||
| 11 | * @ORM\Table(name="doctrine_orm_module_product") |
||
| 12 | */ |
||
| 13 | class Product |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @ORM\Id |
||
| 17 | * @ORM\Column(type="integer"); |
||
| 18 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 19 | */ |
||
| 20 | protected int $id; |
||
|
|
|||
| 21 | |||
| 22 | /** @ORM\Column(type="string", nullable=true) */ |
||
| 23 | protected string $name; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @ORM\ManyToMany(targetEntity="Category") |
||
| 27 | * |
||
| 28 | * @var ?array |
||
| 29 | */ |
||
| 30 | protected $categories; |
||
| 31 | |||
| 32 | public function getId() : ?int |
||
| 33 | { |
||
| 34 | return $this->id; |
||
| 35 | } |
||
| 36 | |||
| 37 | public function setName(string $name) : self |
||
| 38 | { |
||
| 39 | $this->name = $name; |
||
| 40 | |||
| 41 | return $this; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getName() : string |
||
| 45 | { |
||
| 46 | return $this->name; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param Category[] $categories |
||
| 51 | */ |
||
| 52 | public function setCategories(array $categories) : self |
||
| 53 | { |
||
| 54 | $this->categories = $categories; |
||
| 55 | |||
| 56 | return $this; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @return Category[] |
||
| 61 | */ |
||
| 62 | public function getCategories() : array |
||
| 67 |