ProductFamily.php
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
namespace App\Entity;
use App\Repository\ProductFamilyRepository;
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Doctrine\UuidGenerator;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity(repositoryClass=ProductFamilyRepository::class)
* @UniqueEntity(fields="name", message="Une famille de produits portant ce nom existe déjà.")
*/
class ProductFamily
{
/**
* @var \Ramsey\Uuid\UuidInterface
*
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*/
private $id;
/**
* @ORM\Column(type="string", length=100, unique=true)
*/
private $name;
public function getId()
{
return $this->id;
}
/**
* Get name.
*
* @return string name
*/
public function getName(): ?string
{
return $this->name;
}
/**
* Set name.
*
* @return $this
*/
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
}