|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Entity\Settings; |
|
4
|
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
|
6
|
|
|
use Symfony\Component\Validator\Constraints as Assert; |
|
7
|
|
|
use Gedmo\Mapping\Annotation as Gedmo; |
|
8
|
|
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; |
|
9
|
|
|
use App\Entity\Contact; |
|
10
|
|
|
use App\Entity\Settings\Diverse\FamilyLog; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* @ORM\Table(name="app_supplier") |
|
14
|
|
|
* @ORM\Entity(repositoryClass="App\Repository\Settings\SupplierRepository") |
|
15
|
|
|
* @UniqueEntity( |
|
16
|
|
|
* fields="name", |
|
17
|
|
|
* message="This supplier name is already used in the system." |
|
18
|
|
|
* ) |
|
19
|
|
|
*/ |
|
20
|
|
|
class Supplier extends Contact |
|
21
|
|
|
{ |
|
22
|
|
|
/** |
|
23
|
|
|
* @var int id supplier |
|
24
|
|
|
* |
|
25
|
|
|
* @ORM\Column(name="id", type="integer") |
|
26
|
|
|
* @ORM\Id |
|
27
|
|
|
* @ORM\GeneratedValue(strategy="AUTO") |
|
28
|
|
|
*/ |
|
29
|
|
|
private $id; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* @var FamilyLog Famille logistique |
|
33
|
|
|
* @ORM\ManyToOne(targetEntity="App\Entity\Settings\Diverse\FamilyLog") |
|
34
|
|
|
* @ORM\OrderBy({"path" = "asc"}) |
|
35
|
|
|
* @Assert\NotBlank() |
|
36
|
|
|
*/ |
|
37
|
|
|
private $familyLog; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* @var int Delivery time |
|
41
|
|
|
* |
|
42
|
|
|
* @ORM\Column(name="delaydeliv", type="smallint") |
|
43
|
|
|
* @Assert\Length( |
|
44
|
|
|
* max="1", |
|
45
|
|
|
* maxMessage = "Votre choix ne peut pas être que {{ limit }} caractère" |
|
46
|
|
|
* ) |
|
47
|
|
|
* @Assert\NotBlank() |
|
48
|
|
|
*/ |
|
49
|
|
|
private $delayDelivery; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* @var array Table of order days |
|
53
|
|
|
* |
|
54
|
|
|
* @ORM\Column(name="orderdate", type="simple_array") |
|
55
|
|
|
* @Assert\NotBlank(message="Il vous faut choisir au moins 1 date de commande.") |
|
56
|
|
|
*/ |
|
57
|
|
|
private $orderDate; |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @var bool On/Off |
|
61
|
|
|
* |
|
62
|
|
|
* @ORM\Column(name="active", type="boolean") |
|
63
|
|
|
*/ |
|
64
|
|
|
private $active; |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @Gedmo\Slug(fields={"name"}, updatable=false) |
|
68
|
|
|
* @ORM\Column(length=128, unique=true) |
|
69
|
|
|
*/ |
|
70
|
|
|
private $slug; |
|
71
|
|
|
|
|
72
|
|
|
public function __construct() |
|
73
|
|
|
{ |
|
74
|
|
|
$this->active = true; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
public function getId(): int |
|
78
|
|
|
{ |
|
79
|
|
|
return $this->id; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
public function setDelayDelivery(int $delayDelivery): self |
|
83
|
|
|
{ |
|
84
|
|
|
$this->delayDelivery = $delayDelivery; |
|
85
|
|
|
|
|
86
|
|
|
return $this; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
public function getDelayDelivery(): int |
|
90
|
|
|
{ |
|
91
|
|
|
return $this->delayDelivery; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
public function setOrderDate(array $orderDate): self |
|
95
|
|
|
{ |
|
96
|
|
|
$this->orderDate = $orderDate; |
|
97
|
|
|
return $this; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
public function getOrderDate(): array |
|
101
|
|
|
{ |
|
102
|
|
|
return $this->orderDate; |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
public function setFamilyLog(FamilyLog $familyLog): self |
|
106
|
|
|
{ |
|
107
|
|
|
$this->familyLog = $familyLog; |
|
108
|
|
|
|
|
109
|
|
|
return $this; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
public function getFamilyLog(): FamilyLog |
|
113
|
|
|
{ |
|
114
|
|
|
return $this->familyLog; |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
|
|
public function getSlug(): string |
|
118
|
|
|
{ |
|
119
|
|
|
return $this->slug; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
public function setActive(bool $active): self |
|
123
|
|
|
{ |
|
124
|
|
|
$this->active = $active; |
|
125
|
|
|
return $this; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
public function isActive(): bool |
|
129
|
|
|
{ |
|
130
|
|
|
return $this->active; |
|
131
|
|
|
} |
|
132
|
|
|
|
|
133
|
|
|
public function __toString(): string |
|
134
|
|
|
{ |
|
135
|
|
|
return $this->getName(); |
|
136
|
|
|
} |
|
137
|
|
|
} |
|
138
|
|
|
|