1 | <?php |
||
39 | class Article |
||
40 | { |
||
41 | /** |
||
42 | * @var int $artId Id of the article |
||
43 | * |
||
44 | * @ORM\Column(name="id", type="integer") |
||
45 | * @ORM\Id |
||
46 | * @ORM\GeneratedValue(strategy="AUTO") |
||
47 | */ |
||
48 | private $artId; |
||
49 | |||
50 | /** |
||
51 | * @var string $name title of the article |
||
52 | * |
||
53 | * @ORM\Column(name="name", type="string", length=255) |
||
54 | * @Assert\NotBlank() |
||
55 | * @Assert\Regex( |
||
56 | * pattern="'^\w+[^/]'", |
||
57 | * message="L'intitulé ne peut contenir que des lettres, |
||
58 | * chiffres et _ ou -" |
||
59 | * ) |
||
60 | */ |
||
61 | private $name; |
||
62 | |||
63 | /** |
||
64 | * @var string|\App\Entity\Settings\Supplier $supplier Name of supplier |
||
65 | * |
||
66 | * @ORM\ManyToOne(targetEntity="App\Entity\Settings\Supplier") |
||
67 | */ |
||
68 | private $supplier; |
||
69 | |||
70 | /** |
||
71 | * @var string|\App\Entity\Settings\Diverse\Unit $unitStorage Storage unit |
||
72 | * |
||
73 | * @ORM\ManyToOne(targetEntity="App\Entity\Settings\Diverse\Unit") |
||
74 | */ |
||
75 | private $unitStorage; |
||
76 | |||
77 | /** |
||
78 | * @var string|\App\Entity\Settings\Diverse\Unit $unitWorking Working unit |
||
79 | * |
||
80 | * @ORM\ManyToOne(targetEntity="App\Entity\Settings\Diverse\Unit") |
||
81 | */ |
||
82 | private $unitWorking; |
||
83 | |||
84 | /** |
||
85 | * @var double $packaging Conditioning (quantity) |
||
86 | * |
||
87 | * @ORM\Column(name="packaging", type="decimal", precision=7, scale=3) |
||
88 | * @Assert\Type(type="numeric", |
||
89 | * message="La valeur {{ value }} n'est pas un type {{ type }} valide.") |
||
90 | */ |
||
91 | private $packaging; |
||
92 | |||
93 | /** |
||
94 | * @var double $price price of the article |
||
95 | * |
||
96 | * @ORM\Column(name="price", type="decimal", precision=7, scale=3) |
||
97 | * @Assert\Type(type="numeric", |
||
98 | * message="La valeur {{ value }} n'est pas un type {{ type }} valide.") |
||
99 | */ |
||
100 | private $price; |
||
101 | |||
102 | /** |
||
103 | * @var string|\App\Entity\Settings\Diverse\Tva $tva VAT rate |
||
104 | * |
||
105 | * @ORM\ManyToOne(targetEntity="App\Entity\Settings\Diverse\Tva") |
||
106 | */ |
||
107 | private $tva; |
||
108 | |||
109 | /** |
||
110 | * @var double $quantity Quantity in stock |
||
111 | * |
||
112 | * @ORM\Column(name="quantity", type="decimal", precision=7, scale=3, nullable=true, options={"default":0}) |
||
113 | * @Assert\Type(type="numeric", |
||
114 | * message="La valeur {{ value }} n'est pas un type {{ type }} valide.") |
||
115 | */ |
||
116 | private $quantity; |
||
117 | |||
118 | /** |
||
119 | * @var double $minstock Minimum stock |
||
120 | * |
||
121 | * @ORM\Column(name="minstock", type="decimal", precision=7, scale=3) |
||
122 | * @Assert\Type(type="numeric", |
||
123 | * message="La valeur {{ value }} n'est pas un type {{ type }} valide.") |
||
124 | */ |
||
125 | private $minstock; |
||
126 | |||
127 | /** |
||
128 | * @var \Doctrine\Common\Collections\ArrayCollection $zoneStorages Storage area(s) |
||
129 | * |
||
130 | * @ORM\ManyToMany(targetEntity="App\Entity\Settings\Diverse\ZoneStorage") |
||
131 | * @ORM\JoinTable(name="gs_article_zonestorage") |
||
132 | * @Assert\NotBlank() |
||
133 | */ |
||
134 | private $zoneStorages; |
||
135 | |||
136 | /** |
||
137 | * @var string|\App\Entity\Settings\Diverse\FamilyLog $familyLog Logistic family |
||
138 | * |
||
139 | * @ORM\ManyToOne(targetEntity="App\Entity\Settings\Diverse\FamilyLog") |
||
140 | * @Assert\NotBlank() |
||
141 | */ |
||
142 | private $familyLog; |
||
143 | |||
144 | /** |
||
145 | * @var bool On/Off |
||
146 | * |
||
147 | * @ORM\Column(name="active", type="boolean") |
||
148 | */ |
||
149 | private $active; |
||
150 | |||
151 | /** |
||
152 | * @var string $slug |
||
153 | * @Gedmo\Slug(fields={"name"}, updatable=false) |
||
154 | * @ORM\Column(length=128, unique=true) |
||
155 | */ |
||
156 | private $slug; |
||
157 | |||
158 | /** |
||
159 | * Constructor. |
||
160 | */ |
||
161 | public function __construct() |
||
167 | |||
168 | /** |
||
169 | * Get id. |
||
170 | * |
||
171 | * @return int |
||
172 | */ |
||
173 | public function getId() |
||
177 | |||
178 | /** |
||
179 | * Set name. |
||
180 | * |
||
181 | * @param string $name Name of article |
||
182 | * |
||
183 | * @return Article |
||
184 | */ |
||
185 | public function setName($name) |
||
191 | |||
192 | /** |
||
193 | * Get name. |
||
194 | * |
||
195 | * @return string |
||
196 | */ |
||
197 | public function getName() |
||
201 | |||
202 | /** |
||
203 | * Set packaging. |
||
204 | * |
||
205 | * @param double $packaging Conditioning (quantity) |
||
206 | * |
||
207 | * @return Article |
||
208 | */ |
||
209 | public function setPackaging($packaging) |
||
215 | |||
216 | /** |
||
217 | * Get packaging. |
||
218 | * |
||
219 | * @return double |
||
220 | */ |
||
221 | public function getPackaging() |
||
225 | |||
226 | /** |
||
227 | * Set price. |
||
228 | * |
||
229 | * @param double $price price of the article |
||
230 | * |
||
231 | * @return Article |
||
232 | */ |
||
233 | public function setPrice($price) |
||
239 | |||
240 | /** |
||
241 | * Get price. |
||
242 | * |
||
243 | * @return double |
||
244 | */ |
||
245 | public function getPrice() |
||
249 | |||
250 | /** |
||
251 | * Set quantity. |
||
252 | * |
||
253 | * @param double $quantity quantity in stock |
||
254 | * |
||
255 | * @return Article |
||
256 | */ |
||
257 | public function setQuantity($quantity) |
||
263 | |||
264 | /** |
||
265 | * Get quantity. |
||
266 | * |
||
267 | * @return double |
||
268 | */ |
||
269 | public function getQuantity() |
||
273 | |||
274 | /** |
||
275 | * Set minstock. |
||
276 | * |
||
277 | * @param double $minstock minimum stock |
||
278 | * |
||
279 | * @return Article |
||
280 | */ |
||
281 | public function setMinstock($minstock) |
||
287 | |||
288 | /** |
||
289 | * Get minstock. |
||
290 | * |
||
291 | * @return double |
||
292 | */ |
||
293 | public function getMinstock() |
||
297 | |||
298 | /** |
||
299 | * Set supplier. |
||
300 | * |
||
301 | * @param null|\App\Entity\Settings\Supplier $supplier Supplier of the article |
||
302 | * |
||
303 | * @return Article |
||
304 | */ |
||
305 | public function setSupplier(Supplier $supplier = null) |
||
311 | |||
312 | /** |
||
313 | * Get supplier. |
||
314 | * |
||
315 | * @return string|\App\Entity\Settings\Supplier |
||
316 | */ |
||
317 | public function getSupplier() |
||
321 | |||
322 | /** |
||
323 | * Set unitStorage. |
||
324 | * |
||
325 | * @param null|\App\Entity\Settings\Diverse\Unit $unitStorage Storage unit |
||
326 | * |
||
327 | * @return Article |
||
328 | */ |
||
329 | public function setUnitStorage(Unit $unitStorage = null) |
||
335 | |||
336 | /** |
||
337 | * Get unitStorage. |
||
338 | * |
||
339 | * @return string|\App\Entity\Settings\Diverse\Unit |
||
340 | */ |
||
341 | public function getUnitStorage() |
||
345 | |||
346 | /** |
||
347 | * Add zoneStorage. |
||
348 | * |
||
349 | * @param \App\Entity\Settings\Diverse\ZoneStorage $zoneStorages Storage area(s) |
||
350 | * |
||
351 | * @return Article |
||
352 | */ |
||
353 | public function addZoneStorage(ZoneStorage $zoneStorages) |
||
359 | |||
360 | /** |
||
361 | * Remove zoneStorage. |
||
362 | * |
||
363 | * @param \App\Entity\Settings\Diverse\ZoneStorage $zoneStorages Storage area to delete |
||
364 | * |
||
365 | * @return \Doctrine\Common\Collections\ArrayCollection|null |
||
366 | */ |
||
367 | public function removeZoneStorage(ZoneStorage $zoneStorages) |
||
371 | |||
372 | /** |
||
373 | * Get zoneStorage. |
||
374 | * |
||
375 | * @return \Doctrine\Common\Collections\ArrayCollection |
||
376 | */ |
||
377 | public function getZoneStorages() |
||
381 | |||
382 | /** |
||
383 | * Set unitWorking |
||
384 | * |
||
385 | * @param \App\Entity\Settings\Diverse\Unit $unitWorking |
||
386 | * @return Article |
||
387 | */ |
||
388 | public function setUnitWorking(Unit $unitWorking = null) |
||
394 | |||
395 | /** |
||
396 | * Get unitWorking |
||
397 | * |
||
398 | * @return \App\Entity\Settings\Diverse\UnitWorking |
||
399 | */ |
||
400 | public function getUnitWorking() |
||
404 | |||
405 | /** |
||
406 | * Set familyLog. |
||
407 | * |
||
408 | * @param null|\App\Entity\Settings\Diverse\FamilyLog $familyLog Logistics Family |
||
409 | * |
||
410 | * @return Article |
||
411 | */ |
||
412 | public function setFamilyLog(FamilyLog $familyLog = null) |
||
418 | |||
419 | /** |
||
420 | * Get familyLog. |
||
421 | * |
||
422 | * @return \App\Entity\Settings\Diverse\FamilyLog |
||
423 | */ |
||
424 | public function getFamilyLog() |
||
428 | |||
429 | /** |
||
430 | * Set tva |
||
431 | * |
||
432 | * @param \App\Entity\Settings\Diverse\Tva $tva |
||
433 | * @return Article |
||
434 | */ |
||
435 | public function setTva(\App\Entity\Settings\Diverse\Tva $tva = null) |
||
441 | |||
442 | /** |
||
443 | * Get tva |
||
444 | * |
||
445 | * @return \App\Entity\Settings\Diverse\Tva |
||
446 | */ |
||
447 | public function getTva() |
||
451 | |||
452 | /** |
||
453 | * Set active. |
||
454 | * |
||
455 | * @param bool $active On/Off |
||
456 | * |
||
457 | * @return Article |
||
458 | */ |
||
459 | public function setActive($active) |
||
465 | |||
466 | /** |
||
467 | * Is active |
||
468 | * |
||
469 | * @return boolean |
||
470 | */ |
||
471 | public function isActive() |
||
475 | |||
476 | /** |
||
477 | * Get slug |
||
478 | * |
||
479 | * @return string |
||
480 | */ |
||
481 | public function getSlug() |
||
485 | |||
486 | /** |
||
487 | * This method allows to do "echo $article". |
||
488 | * <p> So, to "show" $uniarticlet, |
||
489 | * PHP will actually show the return of this method. <br /> |
||
490 | * Here, the abbreviation, so "echo $article" |
||
491 | * is equivalent to "echo $article->getName()" </ p>. |
||
492 | * |
||
493 | * @return string name |
||
494 | */ |
||
495 | public function __toString() |
||
499 | } |
||
500 |