src/Entity/Product.php line 243

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\_Interface\LocaleInterface;
  4. use App\Repository\ProductRepository;
  5. use App\_Trait\LocaleTrait;
  6. use Cocur\Slugify\Slugify;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use App\Entity\productCategory;
  10. use App\Model\AppConstant;
  11. use Exception;
  12. use JsonSerializable;
  13. use Doctrine\Common\Collections\ArrayCollection;
  14. use Doctrine\Common\Collections\Collection;
  15. #[ORM\Entity(repositoryClass: ProductRepository::class)]
  16. class Product implements JsonSerializable, LocaleInterface
  17. {
  18. const EXCEPTION_CODE = [
  19. "INSUFFICIENT_STOCK" => 4040
  20. ];
  21. use LocaleTrait;
  22. #[ORM\Id]
  23. #[ORM\GeneratedValue]
  24. #[ORM\Column(type: 'integer')]
  25. private $id;
  26. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  27. private $name;
  28. #[ORM\Column(type: 'text', nullable: true)]
  29. private $description;
  30. #[ORM\Column(type: 'decimal', precision: 10, scale: 3)]
  31. private $cost;
  32. #[ORM\ManyToOne(targetEntity: 'ProductCategory', inversedBy: 'products')]
  33. #[ORM\JoinColumn(name: 'id_product_category', referencedColumnName: 'id')]
  34. private $productCategory;
  35. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  36. private $image;
  37. #[ORM\OneToMany(targetEntity: 'FavoriteProduct', mappedBy: 'product')]
  38. private $favoriteProducts;
  39. #[ORM\OneToMany(targetEntity: ProductImages::class, mappedBy: 'product', fetch: 'EAGER', orphanRemoval: true)]
  40. private $productImages;
  41. #[ORM\OneToOne(targetEntity: ViewProduitQteStock::class, mappedBy: 'produit', cascade: ['persist', 'remove'])]
  42. private $produitQteStock;
  43. #[ORM\Column(type: 'boolean', nullable: true)]
  44. private $precommande;
  45. #[ORM\Column(type: 'text', nullable: true)]
  46. private $apropos;
  47. #[ORM\Column(type: 'text', nullable: true)]
  48. private $avertissement;
  49. #[ORM\Column(type: 'text', nullable: true)]
  50. private $precautionsEmploi;
  51. #[ORM\Column(type: 'text', nullable: true)]
  52. private $breveDescription;
  53. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  54. private $volume;
  55. #[ORM\OneToMany(targetEntity: ProductTracabilite::class, mappedBy: 'product')]
  56. private $tracabilites;
  57. #[ORM\Column(type: 'string', length: 255, nullable: true)]
  58. private $legende_image;
  59. #[ORM\Column(length: 255, nullable: true)]
  60. private ?string $metatitle = null;
  61. #[ORM\Column(length: 255, nullable: true)]
  62. private ?string $metadescription = null;
  63. #[ORM\Column(length: 255, nullable: true)]
  64. private ?string $name_english = null;
  65. #[ORM\Column(type: Types::TEXT, nullable: true)]
  66. private ?string $breveDescription_english = null;
  67. #[ORM\Column(type: Types::TEXT, nullable: true)]
  68. private ?string $apropos_english = null;
  69. #[ORM\Column(type: Types::TEXT, nullable: true)]
  70. private ?string $description_english = null;
  71. #[ORM\Column(type: Types::TEXT, nullable: true)]
  72. private ?string $avertissement_english = null;
  73. #[ORM\Column(type: Types::TEXT, nullable: true)]
  74. private ?string $precautionsEmploi_english = null;
  75. #[ORM\Column(nullable: true, options:['default' => 0])]
  76. private ?int $langue = null;
  77. #[ORM\Column(type: Types::TEXT, nullable: true)]
  78. private ?string $legalNotice = null;
  79. #[ORM\Column(type: Types::TEXT, nullable: true)]
  80. private ?string $legalNotice_english = null;
  81. #[ORM\Column(type: Types::TEXT, nullable: true)]
  82. private ?string $originAndCurrentProduction = null;
  83. #[ORM\Column(type: Types::TEXT, nullable: true)]
  84. private ?string $originAndCurrentProduction_english = null;
  85. #[ORM\Column(type: Types::TEXT, nullable: true)]
  86. private ?string $usageTips = null;
  87. #[ORM\Column(type: Types::TEXT, nullable: true)]
  88. private ?string $usageTips_english = null;
  89. #[ORM\Column(type: Types::TEXT, nullable: true)]
  90. private ?string $compositionAndPrecautionsForUse = null;
  91. #[ORM\Column(type: Types::TEXT, nullable: true)]
  92. private ?string $compositionAndPrecautionsForUse_english = null;
  93. #[ORM\Column(type: Types::TEXT, nullable: true)]
  94. private ?string $precautionsGenerales = null;
  95. #[ORM\Column(type: Types::TEXT, nullable: true)]
  96. private ?string $precautionsGenerales_english = null;
  97. #[ORM\Column(length: 255, nullable: true)]
  98. private ?string $referenceSKU = null;
  99. #[ORM\Column(nullable: true)]
  100. private ?bool $featured = null;
  101. #[ORM\Column(type: Types::DECIMAL, precision: 5, scale: 2, nullable: true)]
  102. private ?string $tva = AppConstant::DEFAULT_TVA_STR;
  103. #[ORM\Column(nullable: true)]
  104. private ?bool $isMonthProduct = null;
  105. #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  106. private ?\DateTimeInterface $majDate = null;
  107. #[ORM\Column(nullable: true)]
  108. private ?int $status = null;
  109. /**
  110. * @return Collection<int, FavoriteProduct>
  111. */
  112. public function getFavoriteProducts(): Collection
  113. {
  114. return $this->favoriteProducts;
  115. }
  116. public function getId(): ?int
  117. {
  118. return $this->id;
  119. }
  120. public function getName(): ?string
  121. {
  122. return $this->name;
  123. }
  124. public function setName(?string $name): self
  125. {
  126. $this->name = $name;
  127. return $this;
  128. }
  129. public function getDescription(): ?string
  130. {
  131. return $this->description;
  132. }
  133. public function setDescription(?string $description): self
  134. {
  135. $this->description = $description;
  136. return $this;
  137. }
  138. public function getCost(): ?string
  139. {
  140. return $this->cost;
  141. }
  142. public function setCost(string $cost): self
  143. {
  144. $this->cost = $cost;
  145. return $this;
  146. }
  147. public function getProductCategory(): ?ProductCategory
  148. {
  149. return $this->productCategory;
  150. }
  151. public function setProductCategory(ProductCategory $productCategory): self
  152. {
  153. $this->productCategory = $productCategory;
  154. return $this;
  155. }
  156. public function getImage(): ?string
  157. {
  158. return $this->image;
  159. }
  160. public function setImage(?string $image): self
  161. {
  162. $this->image = $image;
  163. return $this;
  164. }
  165. public function __construct(){
  166. $this->favoriteProducts = new ArrayCollection();
  167. $this->productImages = new ArrayCollection();
  168. $this->tracabilites = new ArrayCollection();
  169. }
  170. // public function __construct(string $name, string $description, string $cost, productCategory $productCategory, string $image){
  171. // $this->setname($name);
  172. // $this->setDescription($description);
  173. // $this->setcost($cost);
  174. // $this->setproductCategory($productCategory);
  175. // $this->setimage($image);
  176. // }
  177. public function jsonSerialize()
  178. {
  179. $vars = get_object_vars($this);
  180. unset($vars["tracabilites"]);
  181. $vars["available"] = $this->isAvailable();
  182. $vars["preOrder"] = $this->isPreOrder();
  183. return $vars;
  184. }
  185. /**
  186. * @return Collection<int, ProductImages>
  187. */
  188. public function getProductImages(): Collection
  189. {
  190. return $this->productImages;
  191. }
  192. public function addProductImage(ProductImages $productImage): self
  193. {
  194. if (!$this->productImages->contains($productImage)) {
  195. $this->productImages[] = $productImage;
  196. $productImage->setProduct($this);
  197. }
  198. return $this;
  199. }
  200. public function removeProductImage(ProductImages $productImage): self
  201. {
  202. if ($this->productImages->removeElement($productImage)) {
  203. // set the owning side to null (unless already changed)
  204. if ($productImage->getProduct() === $this) {
  205. $productImage->setProduct(null);
  206. }
  207. }
  208. return $this;
  209. }
  210. public function getProduitQteStock(): ?ViewProduitQteStock
  211. {
  212. return $this->produitQteStock;
  213. }
  214. public function setProduitQteStock(ViewProduitQteStock $produitQteStock): self
  215. {
  216. // set the owning side of the relation if necessary
  217. if ($produitQteStock->getProduit() !== $this) {
  218. $produitQteStock->setProduit($this);
  219. }
  220. $this->produitQteStock = $produitQteStock;
  221. return $this;
  222. }
  223. public function isPrecommande(): ?bool
  224. {
  225. return $this->precommande;
  226. }
  227. public function setPrecommande(?bool $precommande): self
  228. {
  229. $this->precommande = $precommande;
  230. return $this;
  231. }
  232. public function isAvailable(): bool{
  233. return $this->getProduitQteStock()?->getQteStock() > 0 || $this->isPrecommande();
  234. }
  235. public function isPreOrder(int $qty = 1): bool{
  236. return $this->isPrecommande() && ($this->getProduitQteStock()?->getQteStock() - $qty) <= 0;
  237. }
  238. public function checkQty(float $qty, bool $considerPreOrder = true){
  239. if(!(($considerPreOrder && $this->isPrecommande()) || $this->getProduitQteStock()->getQteStock() >= $qty)){
  240. throw new Exception("Stock insuffisant pour le produit <<".$this->getName(), self::EXCEPTION_CODE['INSUFFICIENT_STOCK']);
  241. }
  242. return true;
  243. }
  244. public function getApropos(): ?string
  245. {
  246. return $this->apropos;
  247. }
  248. public function setApropos(?string $apropos): self
  249. {
  250. $this->apropos = $apropos;
  251. return $this;
  252. }
  253. public function getAvertissement(): ?string
  254. {
  255. return $this->avertissement;
  256. }
  257. public function setAvertissement(?string $avertissement): self
  258. {
  259. $this->avertissement = $avertissement;
  260. return $this;
  261. }
  262. public function getPrecautionsEmploi(): ?string
  263. {
  264. return $this->precautionsEmploi;
  265. }
  266. public function setPrecautionsEmploi(?string $precautionsEmploi): self
  267. {
  268. $this->precautionsEmploi = $precautionsEmploi;
  269. return $this;
  270. }
  271. public function getBreveDescription(): ?string
  272. {
  273. return $this->breveDescription;
  274. }
  275. public function setBreveDescription(?string $breveDescription): self
  276. {
  277. $this->breveDescription = $breveDescription;
  278. return $this;
  279. }
  280. public function getVolume(): ?string
  281. {
  282. return $this->volume;
  283. }
  284. public function setVolume(?string $volume): self
  285. {
  286. $this->volume = $volume;
  287. return $this;
  288. }
  289. /**
  290. * @return Collection<int, ProductTracabilite>
  291. */
  292. public function getTracabilites(): Collection
  293. {
  294. return $this->tracabilites;
  295. }
  296. public function addTracabilite(ProductTracabilite $tracabilite): self
  297. {
  298. if (!$this->tracabilites->contains($tracabilite)) {
  299. $this->tracabilites[] = $tracabilite;
  300. $tracabilite->setProduct($this);
  301. }
  302. return $this;
  303. }
  304. public function removeTracabilite(ProductTracabilite $tracabilite): self
  305. {
  306. if ($this->tracabilites->removeElement($tracabilite)) {
  307. // set the owning side to null (unless already changed)
  308. if ($tracabilite->getProduct() === $this) {
  309. $tracabilite->setProduct(null);
  310. }
  311. }
  312. return $this;
  313. }
  314. /**
  315. * Set the value of tracabilites
  316. *
  317. * @return self
  318. */
  319. public function setTracabilites($tracabilites)
  320. {
  321. $this->tracabilites = $tracabilites;
  322. return $this;
  323. }
  324. public function getSlugCatProduct()
  325. {
  326. return (new Slugify())->slugify($this->productCategory->getName()) ;
  327. }
  328. public function getSlugProduct()
  329. {
  330. return (new Slugify())->slugify($this->getNameByDefaultLocale()) ;
  331. }
  332. public function getLegendeImage(): ?string
  333. {
  334. return $this->legende_image;
  335. }
  336. public function setLegendeImage(?string $legende_image): self
  337. {
  338. $this->legende_image = $legende_image;
  339. return $this;
  340. }
  341. public function getMetatitle(): ?string
  342. {
  343. return $this->metatitle;
  344. }
  345. public function setMetatitle(?string $metatitle): self
  346. {
  347. $this->metatitle = $metatitle;
  348. return $this;
  349. }
  350. public function getMetadescription(): ?string
  351. {
  352. return $this->metadescription;
  353. }
  354. public function setMetadescription(?string $metadescription): self
  355. {
  356. $this->metadescription = $metadescription;
  357. return $this;
  358. }
  359. public function getNameEnglish(): ?string
  360. {
  361. return $this->name_english;
  362. }
  363. public function setNameEnglish(?string $name_english): self
  364. {
  365. $this->name_english = $name_english;
  366. return $this;
  367. }
  368. public function getBreveDescriptionEnglish(): ?string
  369. {
  370. return $this->breveDescription_english;
  371. }
  372. public function setBreveDescriptionEnglish(?string $breveDescription_english): self
  373. {
  374. $this->breveDescription_english = $breveDescription_english;
  375. return $this;
  376. }
  377. public function getAproposEnglish(): ?string
  378. {
  379. return $this->apropos_english;
  380. }
  381. public function setAproposEnglish(?string $apropos_english): self
  382. {
  383. $this->apropos_english = $apropos_english;
  384. return $this;
  385. }
  386. public function getDescriptionEnglish(): ?string
  387. {
  388. return $this->description_english;
  389. }
  390. public function setDescriptionEnglish(?string $description_english): self
  391. {
  392. $this->description_english = $description_english;
  393. return $this;
  394. }
  395. public function getAvertissementEnglish(): ?string
  396. {
  397. return $this->avertissement_english;
  398. }
  399. public function setAvertissementEnglish(?string $avertissement_english): self
  400. {
  401. $this->avertissement_english = $avertissement_english;
  402. return $this;
  403. }
  404. public function getPrecautionsEmploiEnglish(): ?string
  405. {
  406. return $this->precautionsEmploi_english;
  407. }
  408. public function setPrecautionsEmploiEnglish(?string $precautionsEmploi_english): self
  409. {
  410. $this->precautionsEmploi_english = $precautionsEmploi_english;
  411. return $this;
  412. }
  413. /** Permet de récuperer le nom du produit en fonction de la version (langue) */
  414. public function getNameByDefaultLocale()
  415. {
  416. $name = '';
  417. if ($GLOBALS['app_default_locale'] === 'fr' ) {
  418. $name = $this->name;
  419. }else if($GLOBALS['app_default_locale'] === 'en'){
  420. $name = ($this->name_english === '' or is_null($this->name_english)) ? $this->name : $this->name_english ;
  421. }
  422. return $name;
  423. }
  424. public function getBreveDescriptionByDefaultLocale()
  425. {
  426. $breveDescription = '';
  427. if ($GLOBALS['app_default_locale'] === 'fr') {
  428. $breveDescription = $this->breveDescription;
  429. }else if($GLOBALS['app_default_locale'] === 'en'){
  430. $breveDescription = ($this->breveDescription_english === '' or is_null($this->breveDescription_english)) ? '' : $this->breveDescription_english ;
  431. }
  432. return $breveDescription;
  433. }
  434. public function getAproposByDefaultLocale()
  435. {
  436. $apropos = '';
  437. if ($GLOBALS['app_default_locale'] === 'fr') {
  438. $apropos = $this->apropos;
  439. }else if($GLOBALS['app_default_locale'] === 'en'){
  440. $apropos = ($this->apropos_english === '' or is_null($this->apropos_english)) ? '' : $this->apropos_english ;
  441. }
  442. return $apropos;
  443. }
  444. public function getDescriptionByDefaultLocale()
  445. {
  446. $description = '';
  447. if ($GLOBALS['app_default_locale'] === 'fr') {
  448. $description = $this->description;
  449. }else if($GLOBALS['app_default_locale'] === 'en'){
  450. $description = ($this->description === '' or is_null($this->description_english)) ? '' : $this->description_english ;
  451. }
  452. return $description;
  453. }
  454. public function getAvertissementByDefaultLocale()
  455. {
  456. $avertissement = '';
  457. if ($GLOBALS['app_default_locale'] === 'fr') {
  458. $avertissement = $this->avertissement;
  459. }else if($GLOBALS['app_default_locale'] === 'en'){
  460. $avertissement = ($this->avertissement_english === '' or is_null($this->avertissement_english)) ? '' : $this->avertissement_english ;
  461. }
  462. return $avertissement;
  463. }
  464. public function getPrecautionsEmploiByDefaultLocale()
  465. {
  466. $precautionsEmploi = '';
  467. if ($GLOBALS['app_default_locale'] === 'fr') {
  468. $precautionsEmploi = $this->precautionsEmploi;
  469. }else if($GLOBALS['app_default_locale'] === 'en'){
  470. $precautionsEmploi = ($this->precautionsEmploi_english === '' or is_null($this->precautionsEmploi_english)) ? '' : $this->precautionsEmploi_english ;
  471. }
  472. return $precautionsEmploi;
  473. }
  474. public function getLangue(): ?int
  475. {
  476. return $this->langue;
  477. }
  478. public function setLangue(?int $langue): self
  479. {
  480. $this->langue = $langue;
  481. return $this;
  482. }
  483. public function getLegalNotice(): ?string
  484. {
  485. return $this->legalNotice;
  486. }
  487. public function setLegalNotice(?string $legalNotice): self
  488. {
  489. $this->legalNotice = $legalNotice;
  490. return $this;
  491. }
  492. public function getLegalNoticeEnglish(): ?string
  493. {
  494. return $this->legalNotice_english;
  495. }
  496. public function setLegalNoticeEnglish(?string $legalNotice_english): self
  497. {
  498. $this->legalNotice_english = $legalNotice_english;
  499. return $this;
  500. }
  501. public function getOriginAndCurrentProduction(): ?string
  502. {
  503. return $this->originAndCurrentProduction;
  504. }
  505. public function setOriginAndCurrentProduction(?string $originAndCurrentProduction): self
  506. {
  507. $this->originAndCurrentProduction = $originAndCurrentProduction;
  508. return $this;
  509. }
  510. public function getOriginAndCurrentProductionEnglish(): ?string
  511. {
  512. return $this->originAndCurrentProduction_english;
  513. }
  514. public function setOriginAndCurrentProductionEnglish(?string $originAndCurrentProduction_english): self
  515. {
  516. $this->originAndCurrentProduction_english = $originAndCurrentProduction_english;
  517. return $this;
  518. }
  519. public function getUsageTips(): ?string
  520. {
  521. return $this->usageTips;
  522. }
  523. public function setUsageTips(?string $usageTips): self
  524. {
  525. $this->usageTips = $usageTips;
  526. return $this;
  527. }
  528. public function getUsageTipsEnglish(): ?string
  529. {
  530. return $this->usageTips_english;
  531. }
  532. public function setUsageTipsEnglish(?string $usageTips_english): self
  533. {
  534. $this->usageTips_english = $usageTips_english;
  535. return $this;
  536. }
  537. public function getCompositionAndPrecautionsForUse(): ?string
  538. {
  539. return $this->compositionAndPrecautionsForUse;
  540. }
  541. public function setCompositionAndPrecautionsForUse(?string $compositionAndPrecautionsForUse): self
  542. {
  543. $this->compositionAndPrecautionsForUse = $compositionAndPrecautionsForUse;
  544. return $this;
  545. }
  546. public function getCompositionAndPrecautionsForUseEnglish(): ?string
  547. {
  548. return $this->compositionAndPrecautionsForUse_english;
  549. }
  550. public function setCompositionAndPrecautionsForUseEnglish(?string $compositionAndPrecautionsForUse_english): self
  551. {
  552. $this->compositionAndPrecautionsForUse_english = $compositionAndPrecautionsForUse_english;
  553. return $this;
  554. }
  555. public function getLegalNoticeByDefaultLocale()
  556. {
  557. $legalNotice = '';
  558. if ($GLOBALS['app_default_locale'] === 'fr') {
  559. $legalNotice = $this->legalNotice;
  560. }else if($GLOBALS['app_default_locale'] === 'en'){
  561. $legalNotice = ($this->legalNotice_english === '' or is_null($this->legalNotice_english)) ? '' : $this->legalNotice_english ;
  562. }
  563. return $legalNotice;
  564. }
  565. public function getOriginAndCurrentProductionByDefaultLocale()
  566. {
  567. $origin_CProduct = '';
  568. if ($GLOBALS['app_default_locale'] === 'fr') {
  569. $origin_CProduct = $this->originAndCurrentProduction;
  570. }else if($GLOBALS['app_default_locale'] === 'en'){
  571. $origin_CProduct = ($this->originAndCurrentProduction_english === '' or is_null($this->originAndCurrentProduction_english)) ? '' : $this->originAndCurrentProduction_english ;
  572. }
  573. return $origin_CProduct;
  574. }
  575. public function getUsageTipsByDefaultLocale()
  576. {
  577. $usageTips = '';
  578. if ($GLOBALS['app_default_locale'] === 'fr') {
  579. $usageTips = $this->usageTips;
  580. }else if($GLOBALS['app_default_locale'] === 'en'){
  581. $usageTips = ($this->usageTips_english === '' or is_null($this->usageTips_english)) ? '' : $this->usageTips_english ;
  582. }
  583. return $usageTips;
  584. }
  585. public function getCompositionAndPrecautionsForUseByDefaultLocale()
  586. {
  587. $compAndPreForUse = '';
  588. if ($GLOBALS['app_default_locale'] === 'fr') {
  589. $compAndPreForUse = $this->compositionAndPrecautionsForUse;
  590. }else if($GLOBALS['app_default_locale'] === 'en'){
  591. $compAndPreForUse = ($this->compositionAndPrecautionsForUse_english === '' or is_null($this->compositionAndPrecautionsForUse_english)) ? '' : $this->compositionAndPrecautionsForUse_english ;
  592. }
  593. return $compAndPreForUse;
  594. }
  595. public function getGeneralPrecautionByDefaultLocale()
  596. {
  597. $generalPrecautions = '';
  598. if ($GLOBALS['app_default_locale'] === 'fr') {
  599. $generalPrecautions = $this->precautionsGenerales;
  600. }else if($GLOBALS['app_default_locale'] === 'en'){
  601. $generalPrecautions = ($this->precautionsGenerales_english === '' or is_null($this->precautionsGenerales_english)) ? '' : $this->precautionsGenerales_english ;
  602. }
  603. return $generalPrecautions;
  604. }
  605. public function getPrecautionsGenerales(): ?string
  606. {
  607. return $this->precautionsGenerales;
  608. }
  609. public function setPrecautionsGenerales(?string $precautionsGenerales): self
  610. {
  611. $this->precautionsGenerales = $precautionsGenerales;
  612. return $this;
  613. }
  614. public function getPrecautionsGeneralesEnglish(): ?string
  615. {
  616. return $this->precautionsGenerales_english;
  617. }
  618. public function setPrecautionsGeneralesEnglish(?string $precautionsGenerales_english): self
  619. {
  620. $this->precautionsGenerales_english = $precautionsGenerales_english;
  621. return $this;
  622. }
  623. public function getReferenceSKU(): ?string
  624. {
  625. return $this->referenceSKU;
  626. }
  627. public function setReferenceSKU(?string $referenceSKU): self
  628. {
  629. $this->referenceSKU = $referenceSKU;
  630. return $this;
  631. }
  632. public function isFeatured(): ?bool
  633. {
  634. return $this->featured;
  635. }
  636. public function setFeatured(?bool $featured): self
  637. {
  638. $this->featured = $featured;
  639. return $this;
  640. }
  641. public function getTva(): ?string
  642. {
  643. return $this->tva;
  644. }
  645. public function setTva(?string $tva): self
  646. {
  647. $this->tva = $tva;
  648. return $this;
  649. }
  650. public function isIsMonthProduct(): ?bool
  651. {
  652. return $this->isMonthProduct;
  653. }
  654. public function setIsMonthProduct(?bool $isMonthProduct): self
  655. {
  656. $this->isMonthProduct = $isMonthProduct;
  657. return $this;
  658. }
  659. public function getMajDate(): ?\DateTimeInterface
  660. {
  661. return $this->majDate;
  662. }
  663. public function setMajDate(?\DateTimeInterface $majDate): self
  664. {
  665. $this->majDate = $majDate;
  666. return $this;
  667. }
  668. public function getStatus(): ?int
  669. {
  670. return $this->status;
  671. }
  672. public function setStatus(?int $status): self
  673. {
  674. $this->status = $status;
  675. return $this;
  676. }
  677. }