src/Entity/LetterOfIntentToPurchase.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\LetterOfIntentToPurchaseRepository")
  8.  */
  9. class LetterOfIntentToPurchase
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      */
  20.     private $reference;
  21.      /**
  22.      * @ORM\Column(type="string", length=255, nullable=true)
  23.      */
  24.     private $mandataire;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\AdminDonneurOrdre", inversedBy="letterOfIntentToPurchases")
  27.      */
  28.     private $recipient;
  29.     /**
  30.      * @ORM\Column(type="datetime", nullable=true)
  31.      */
  32.     private $date_saisie;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $representant;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      */
  40.     private $entreprise;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $numero_rc;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $pays;
  49.     /**
  50.      * @ORM\Column(type="string", length=255, nullable=true)
  51.      */
  52.     private $phone;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      * *@Assert\Email(
  56.      *  message = "The email '{{ value }}' is not a valid email."
  57.      * )
  58.      */
  59.     private $email;
  60.     /**
  61.      * @ORM\Column(type="string", length=255, nullable=true)
  62.      */
  63.     private $product;
  64.     /**
  65.      * @ORM\Column(type="string", length=255, nullable=true)
  66.      */
  67.     private $quantity;
  68.     /**
  69.      * @ORM\Column(type="string", length=255, nullable=true)
  70.      */
  71.     private $origine;
  72.     /**
  73.      * @ORM\Column(type="string", length=255, nullable=true)
  74.      */
  75.     private $prix_cible;
  76.     /**
  77.      * @ORM\Column(type="string", length=255, nullable=true)
  78.      */
  79.     private $destination;
  80.     /**
  81.      * @ORM\Column(type="string", length=255, nullable=true)
  82.      */
  83.     private $delai_livraison;
  84.     /**
  85.      * @ORM\Column(type="string", length=255, nullable=true)
  86.      */
  87.     private $frequence;
  88.     /**
  89.      * @ORM\Column(type="string", length=255, nullable=true)
  90.      */
  91.     private $condition;
  92.     /**
  93.      * @ORM\Column(type="string", length=255, nullable=true)
  94.      */
  95.     private $adminName;
  96.     /**
  97.      * @ORM\Column(type="text", nullable=true, nullable=true)
  98.      */
  99.     private $specification;
  100.     /**
  101.      * @ORM\Column(type="string", length=255, nullable=true)
  102.      */
  103.     private $date_expiration;
  104.     /**
  105.      * @ORM\Column(type="datetime")
  106.      */
  107.     private $createdAt;
  108.     /**
  109.      * @ORM\ManyToOne(targetEntity="App\Entity\SousJacent", inversedBy="letterOfIntentToPurchases")
  110.      */
  111.     private $sousJacent;
  112.     /**
  113.      * @ORM\ManyToOne(targetEntity="App\Entity\Products", inversedBy="letterOfIntentToPurchases")
  114.      */
  115.     private $filiere;
  116.     /**
  117.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="letterOfIntentToPurchases")
  118.      */
  119.     private $agent;
  120.       /**
  121.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="letterOfIntentToPurchases")
  122.      */
  123.     private $suivipar;
  124.     /**
  125.      * @ORM\ManyToOne(targetEntity="App\Entity\Status", inversedBy="letterOfIntentToPurchases")
  126.      */
  127.     private $status;
  128.     /**
  129.      * @ORM\ManyToOne(targetEntity="App\Entity\PaymentMethod", inversedBy="letterOfIntentToPurchases")
  130.      */
  131.     private $payment_method;
  132.     /**
  133.      * @ORM\ManyToOne(targetEntity="App\Entity\Unite", inversedBy="letterOfIntentToPurchases")
  134.      */
  135.     private $qt_unite;
  136.     /**
  137.      * @ORM\ManyToOne(targetEntity="App\Entity\Devise", inversedBy="letterOfIntentToPurchases")
  138.      */
  139.     private $devise;
  140.     /**
  141.      * @ORM\ManyToOne(targetEntity="App\Entity\PaymentMethod", inversedBy="letterOfIntentToPurchases")
  142.      */
  143.     private $paiement_mode;
  144.     /**
  145.      * @ORM\ManyToOne(targetEntity="App\Entity\Niveau", inversedBy="letterOfIntentToPurchases")
  146.      */
  147.     private $niveau;
  148.     /**
  149.      * @ORM\ManyToOne(targetEntity="App\Entity\Emballage", inversedBy="letterOfIntentToPurchases")
  150.      */
  151.     private $emballage;
  152.     /**
  153.      * @ORM\ManyToOne(targetEntity="App\Entity\Conditionnement", inversedBy="letterOfIntentToPurchases")
  154.      */
  155.     private $conditionnement;
  156.     /**
  157.      * @ORM\ManyToOne(targetEntity="App\Entity\Exigence", inversedBy="letterOfIntentToPurchases")
  158.      */
  159.     private $exigence;
  160.     public function __construct()
  161.     {
  162.         $this->createdAt = new \DateTime('now');
  163.         if (!isset($this->reference)){
  164.             $this->reference 'LIA'.random_int(1,99).date('s');
  165.         }else{
  166.             $this->reference 'LIA'.random_int(1,99).date('s');
  167.         }
  168.     }
  169.     public function getId(): ?int
  170.     {
  171.         return $this->id;
  172.     }
  173.     /**
  174.      * @return mixed
  175.      */
  176.     public function getReference()
  177.     {
  178.         return $this->reference;
  179.     }
  180.     /**
  181.      * @param string $reference
  182.      * @return LetterOfIntentToPurchase
  183.      */
  184.     public function setReference($reference)
  185.     {
  186.         $this->reference $reference;
  187.         return $this;
  188.     }
  189.     /**
  190.      * @return mixed
  191.      */
  192.     public function getRecipient(): ?AdminDonneurOrdre
  193.     {
  194.         return $this->recipient;
  195.     }
  196.     public function setRecipient(?AdminDonneurOrdre $recipient):self
  197.     {
  198.         $this->recipient $recipient;
  199.         return $this;
  200.     }
  201.     /**
  202.      * @return mixed
  203.      */
  204.     public function getDateSaisie():?\DateTimeInterface
  205.     {
  206.         return $this->date_saisie;
  207.     }
  208.     /**
  209.      * @param mixed $date_saisie
  210.      * @return LetterOfIntentToPurchase
  211.      */
  212.     public function setDateSaisie(?\DateTimeInterface $date_saisie):self
  213.     {
  214.         $this->date_saisie $date_saisie;
  215.         return $this;
  216.     }
  217.     /**
  218.      * @return mixed
  219.      */
  220.     public function getRepresentant():?string
  221.     {
  222.         return $this->representant;
  223.     }
  224.     /**
  225.      * @param mixed $representant
  226.      * @return LetterOfIntentToPurchase
  227.      */
  228.     public function setRepresentant(?string $representant):self
  229.     {
  230.         $this->representant $representant;
  231.         return $this;
  232.     }
  233.     /**
  234.      * @return mixed
  235.      */
  236.     public function getEntreprise():?string
  237.     {
  238.         return $this->entreprise;
  239.     }
  240.     /**
  241.      * @param mixed $entreprise
  242.      * @return LetterOfIntentToPurchase
  243.      */
  244.     public function setEntreprise(?string $entreprise):self
  245.     {
  246.         $this->entreprise $entreprise;
  247.         return $this;
  248.     }
  249.     /**
  250.      * @return mixed
  251.      */
  252.     public function getNumeroRc():?string
  253.     {
  254.         return $this->numero_rc;
  255.     }
  256.     /**
  257.      * @param mixed $numero_rc
  258.      * @return LetterOfIntentToPurchase
  259.      */
  260.     public function setNumeroRc(?string $numero_rc):self
  261.     {
  262.         $this->numero_rc $numero_rc;
  263.         return $this;
  264.     }
  265.     /**
  266.      * @return mixed
  267.      */
  268.     public function getPays():?string
  269.     {
  270.         return $this->pays;
  271.     }
  272.     /**
  273.      * @param mixed $pays
  274.      * @return LetterOfIntentToPurchase
  275.      */
  276.     public function setPays(?string $pays):self
  277.     {
  278.         $this->pays $pays;
  279.         return $this;
  280.     }
  281.     /**
  282.      * @return mixed
  283.      */
  284.     public function getPhone():?string
  285.     {
  286.         return $this->phone;
  287.     }
  288.     /**
  289.      * @param mixed $phone
  290.      * @return LetterOfIntentToPurchase
  291.      */
  292.     public function setPhone(?string $phone):self
  293.     {
  294.         $this->phone $phone;
  295.         return $this;
  296.     }
  297.     /**
  298.      * @return mixed
  299.      */
  300.     public function getEmail():?string
  301.     {
  302.         return $this->email;
  303.     }
  304.     /**
  305.      * @param mixed $email
  306.      * @return LetterOfIntentToPurchase
  307.      */
  308.     public function setEmail(?string $email)
  309.     {
  310.         $this->email $email;
  311.         return $this;
  312.     }
  313.     /**
  314.      * @return mixed
  315.      */
  316.     public function getProduct():?string
  317.     {
  318.         return $this->product;
  319.     }
  320.     /**
  321.      * @param mixed $product
  322.      * @return LetterOfIntentToPurchase
  323.      */
  324.     public function setProduct(?string $product):self
  325.     {
  326.         $this->product $product;
  327.         return $this;
  328.     }
  329.     /**
  330.      * @return mixed
  331.      */
  332.     public function getQuantity():?string
  333.     {
  334.         return $this->quantity;
  335.     }
  336.     /**
  337.      * @param mixed $quantity
  338.      * @return LetterOfIntentToPurchase
  339.      */
  340.     public function setQuantity($quantity)
  341.     {
  342.         $this->quantity = (float)str_ireplace(',','.',$quantity);
  343.         return $this;
  344.     }
  345.     /**
  346.      * @return mixed
  347.      */
  348.     public function getOrigine()
  349.     {
  350.         return $this->origine;
  351.     }
  352.     /**
  353.      * @param mixed $origine
  354.      * @return LetterOfIntentToPurchase
  355.      */
  356.     public function setOrigine($origine)
  357.     {
  358.         $this->origine $origine;
  359.         return $this;
  360.     }
  361.     /**
  362.      * @return mixed
  363.      */
  364.     public function getPrixCible()
  365.     {
  366.         return $this->prix_cible;
  367.     }
  368.     /**
  369.      * @param mixed $prix_cible
  370.      * @return LetterOfIntentToPurchase
  371.      */
  372.     public function setPrixCible($prix_cible)
  373.     {
  374.         $this->prix_cible = (float)str_ireplace(',','.',$prix_cible);
  375.         return $this;
  376.     }
  377.     /**
  378.      * @return mixed
  379.      */
  380.     public function getDestination()
  381.     {
  382.         return $this->destination;
  383.     }
  384.     /**
  385.      * @param mixed $destination
  386.      * @return LetterOfIntentToPurchase
  387.      */
  388.     public function setDestination($destination)
  389.     {
  390.         $this->destination $destination;
  391.         return $this;
  392.     }
  393.     /**
  394.      * @return mixed
  395.      */
  396.     public function getDelaiLivraison()
  397.     {
  398.         return $this->delai_livraison;
  399.     }
  400.     /**
  401.      * @param mixed $delai_livraison
  402.      * @return LetterOfIntentToPurchase
  403.      */
  404.     public function setDelaiLivraison($delai_livraison)
  405.     {
  406.         $this->delai_livraison $delai_livraison;
  407.         return $this;
  408.     }
  409.     /**
  410.      * @return mixed
  411.      */
  412.     public function getFrequence()
  413.     {
  414.         return $this->frequence;
  415.     }
  416.     /**
  417.      * @param mixed $frequence
  418.      * @return LetterOfIntentToPurchase
  419.      */
  420.     public function setFrequence($frequence)
  421.     {
  422.         $this->frequence $frequence;
  423.         return $this;
  424.     }
  425.     /**
  426.      * @return mixed
  427.      */
  428.     public function getCondition()
  429.     {
  430.         return $this->condition;
  431.     }
  432.     /**
  433.      * @param mixed $condition
  434.      * @return LetterOfIntentToPurchase
  435.      */
  436.     public function setCondition($condition)
  437.     {
  438.         $this->condition $condition;
  439.         return $this;
  440.     }
  441.     /**
  442.      * @return mixed
  443.      */
  444.     public function getAdminName()
  445.     {
  446.         return $this->adminName;
  447.     }
  448.     /**
  449.      * @param mixed $adminName
  450.      * @return LetterOfIntentToPurchase
  451.      */
  452.     public function setAdminName($adminName)
  453.     {
  454.         $this->adminName $adminName;
  455.         return $this;
  456.     }
  457.     /**
  458.      * @return mixed
  459.      */
  460.     public function getSpecification()
  461.     {
  462.         return $this->specification;
  463.     }
  464.     /**
  465.      * @param mixed $specification
  466.      * @return LetterOfIntentToPurchase
  467.      */
  468.     public function setSpecification($specification)
  469.     {
  470.         $this->specification $specification;
  471.         return $this;
  472.     }
  473.     /**
  474.      * @return mixed
  475.      */
  476.     public function getDateExpiration()
  477.     {
  478.         return $this->date_expiration;
  479.     }
  480.     /**
  481.      * @param mixed $date_expiration
  482.      * @return LetterOfIntentToPurchase
  483.      */
  484.     public function setDateExpiration($date_expiration)
  485.     {
  486.         $this->date_expiration $date_expiration;
  487.         return $this;
  488.     }
  489.     /**
  490.      * @return DateTime
  491.      */
  492.     public function getCreatedAt(): DateTime
  493.     {
  494.         return $this->createdAt;
  495.     }
  496.     /**
  497.      * @param DateTime $createdAt
  498.      * @return LetterOfIntentToPurchase
  499.      */
  500.     public function setCreatedAt(DateTime $createdAt): LetterOfIntentToPurchase
  501.     {
  502.         $this->createdAt $createdAt;
  503.         return $this;
  504.     }
  505.     
  506.     public function __toString(){
  507.         return $this->reference;
  508.     }
  509.     public function getSousJacent(): ?SousJacent
  510.     {
  511.         return $this->sousJacent;
  512.     }
  513.     public function setSousJacent(?SousJacent $sousJacent): self
  514.     {
  515.         $this->sousJacent $sousJacent;
  516.         return $this;
  517.     }
  518.     public function getFiliere(): ?Products
  519.     {
  520.         return $this->filiere;
  521.     }
  522.     public function setFiliere(?Products $filiere): self
  523.     {
  524.         $this->filiere $filiere;
  525.         return $this;
  526.     }
  527.     public function getAgent(): ?User
  528.     {
  529.         return $this->agent;
  530.     }
  531.     public function setAgent(?User $agent): self
  532.     {
  533.         $this->agent $agent;
  534.         return $this;
  535.     }
  536.     public function getSuivipar(): ?User
  537.     {
  538.         return $this->suivipar;
  539.     }
  540.     public function setSuivipar(?User $suivipar): self
  541.     {
  542.         $this->suivipar $suivipar;
  543.         return $this;
  544.     }
  545.     public function getStatus(): ?Status
  546.     {
  547.         return $this->status;
  548.     }
  549.     public function setStatus(?Status $status): self
  550.     {
  551.         $this->status $status;
  552.         return $this;
  553.     }
  554.     public function getPaymentMethod(): ?PaymentMethod
  555.     {
  556.         return $this->payment_method;
  557.     }
  558.     public function setPaymentMethod(?PaymentMethod $payment_method): self
  559.     {
  560.         $this->payment_method $payment_method;
  561.         return $this;
  562.     }
  563.     public function getQtUnite(): ?Unite
  564.     {
  565.         return $this->qt_unite;
  566.     }
  567.     public function setQtUnite(?Unite $qt_unite): self
  568.     {
  569.         $this->qt_unite $qt_unite;
  570.         return $this;
  571.     }
  572.     public function getDevise(): ?Devise
  573.     {
  574.         return $this->devise;
  575.     }
  576.     public function setDevise(?Devise $devise): self
  577.     {
  578.         $this->devise $devise;
  579.         return $this;
  580.     }
  581.     public function getPaiementMode(): ?PaymentMethod
  582.     {
  583.         return $this->paiement_mode;
  584.     }
  585.     public function setPaiementMode(?PaymentMethod $paiement_mode): self
  586.     {
  587.         $this->paiement_mode $paiement_mode;
  588.         return $this;
  589.     }
  590.     public function getNiveau(): ?Niveau
  591.     {
  592.         return $this->niveau;
  593.     }
  594.     public function setNiveau(?Niveau $niveau): self
  595.     {
  596.         $this->niveau $niveau;
  597.         return $this;
  598.     }
  599.     public function getEmballage(): ?Emballage
  600.     {
  601.         return $this->emballage;
  602.     }
  603.     public function setEmballage(?Emballage $emballage): self
  604.     {
  605.         $this->emballage $emballage;
  606.         return $this;
  607.     }
  608.     public function getConditionnement(): ?Conditionnement
  609.     {
  610.         return $this->conditionnement;
  611.     }
  612.     public function setConditionnement(?Conditionnement $conditionnement): self
  613.     {
  614.         $this->conditionnement $conditionnement;
  615.         return $this;
  616.     }
  617.     public function getExigence(): ?Exigence
  618.     {
  619.         return $this->exigence;
  620.     }
  621.     public function setExigence(?Exigence $exigence): self
  622.     {
  623.         $this->exigence $exigence;
  624.         return $this;
  625.     }
  626.     public function getMandataire(): ?string
  627.     {
  628.         return $this->mandataire;
  629.     }
  630.     public function setMandataire(?string $mandataire): self
  631.     {
  632.         $this->mandataire $mandataire;
  633.         return $this;
  634.     }
  635. }