src/Entity/Commande.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\SpecialiteDocteur as SpecialiteDocteur;
  4. use App\Entity\Symptome as Symptome;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use App\Entity\Client;
  10. use App\Repository\CommandeRepository;
  11. /**
  12.  * Commande
  13.  *
  14.  * @ApiResource
  15.  * @ORM\Entity(repositoryClass=CommandeRepository::class)
  16.  * @ORM\Table()
  17.  */
  18. class Commande
  19. {
  20.     /**
  21.      * @var int
  22.      *
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     /**
  29.      * @var string
  30.      *
  31.      * @ORM\Column(name="nom", type="string", length=100, nullable=true)
  32.      *
  33.      * @Assert\NotBlank()
  34.      */
  35.     private $nom;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="prenom", type="string", length=100, nullable=true)
  40.      *
  41.      * @Assert\NotBlank()
  42.      */
  43.     private $prenom;
  44.     /**
  45.      * @var string
  46.      *
  47.      * @ORM\Column(name="email", type="string", length=255)
  48.      *
  49.      * @Assert\NotBlank()
  50.      */
  51.     private $email;
  52.     /**
  53.      * @var string
  54.      *
  55.      * @ORM\Column(name="tel", type="string", length=20)
  56.      *
  57.      * @Assert\NotBlank()
  58.      */
  59.     private $tel;
  60.     /**
  61.      * @var string
  62.      *
  63.      * @ORM\Column(name="sexe", type="string", length=20, nullable=true)
  64.      */
  65.     private $sexe;
  66.     /**
  67.      * @var string
  68.      *
  69.      * @ORM\Column(name="age", type="integer", nullable=true)
  70.      *
  71.      * @Assert\NotBlank()
  72.      */
  73.     private $age;
  74.     /**
  75.      * @var string
  76.      *
  77.      * @ORM\Column(name="adresse", type="string", length=255, nullable=true)
  78.      */
  79.     private $adresse;
  80.     /**
  81.      * @var string
  82.      *
  83.      * @ORM\Column(name="complement", type="string", length=255, nullable=true)
  84.      */
  85.     private $complement;
  86.     /**
  87.      * @ORM\Column(name="codePostal", type="string", length=10, nullable=true)
  88.      */
  89.     private $codePostal;
  90.     /**
  91.      * @ORM\Column(name="stripeCustomer", type="string", nullable=true)
  92.      */
  93.     private $stripeCustomer;
  94.     /**
  95.      * @ORM\Column(name="paymentMethod", type="string", nullable=true)
  96.      */
  97.     private $paymentMethod;
  98.     /**
  99.      * @var datetime
  100.      *
  101.      * @ORM\Column(name="horodateCreation", type="datetime")
  102.      *
  103.      * @Assert\NotBlank()
  104.      */
  105.     private $horodateCreation;
  106.     /**
  107.      * @var SpecialiteDocteur
  108.      *
  109.      * @ORM\ManyToOne(targetEntity="App\Entity\SpecialiteDocteur")
  110.      * @ORM\JoinColumn(onDelete="SET NULL")
  111.      */
  112.     private $specialite;
  113.     /**
  114.      * @var Symptome
  115.      *
  116.      * @ORM\ManyToOne(targetEntity="App\Entity\Symptome", cascade={"persist"})
  117.      * @ORM\JoinColumn(onDelete="SET NULL")
  118.      */
  119.     private $symptome;
  120.     /**
  121.      * @var Client
  122.      *
  123.      * @ORM\ManyToOne(targetEntity=Client::class, cascade={"persist"})
  124.      * @ORM\JoinColumn(onDelete="SET NULL")
  125.      */
  126.     private $client;
  127.     /**
  128.      * @var bool
  129.      *
  130.      * @ORM\Column(name="actif", type="boolean", nullable=true)
  131.      */
  132.     private $actif;
  133.     /**
  134.      * @var bool
  135.      *
  136.      * @ORM\Column(name="traite", type="boolean")
  137.      */
  138.     private $traite false;
  139.     /**
  140.      * @var bool
  141.      *
  142.      * @ORM\Column(name="converted", type="boolean", nullable=true)
  143.      */
  144.     private $converted false;
  145.     /**
  146.      * @var bool
  147.      *
  148.      * @ORM\Column(name="reminderSended", type="boolean", nullable=true)
  149.      */
  150.     private $reminderSended false;
  151.     /**
  152.      * @var bool
  153.      *
  154.      * @ORM\Column(name="type", type="string", nullable=true)
  155.      */
  156.     private $type;
  157.     /**
  158.      * @var string
  159.      *
  160.      * @ORM\Column(name="hubspotDealId", type="string", nullable=true)
  161.      */
  162.     private $hubspotDealId;
  163.     /**
  164.      * @var string
  165.      *
  166.      * @ORM\Column(name="hubspot_contact_id", type="string", nullable=true)
  167.      *
  168.      */
  169.     private $hubspotContactId;
  170.     /**
  171.      * Constructor of Commande Entity
  172.      */
  173.     public function __construct()
  174.     {
  175.         $this->horodateCreation = new \DateTime;
  176.         // $this->age = 0;
  177.         $this->actif true;
  178.     }
  179.     public function __toString()
  180.     {
  181.         return ($this->getNom()) ? $this->getNom() : '';
  182.     }
  183.     /**
  184.      * Get id
  185.      *
  186.      * @return integer
  187.      */
  188.     public function getId()
  189.     {
  190.         return $this->id;
  191.     }
  192.     /**
  193.      * Get nom
  194.      *
  195.      * @return string
  196.      */
  197.     public function getNom()
  198.     {
  199.         return $this->nom;
  200.     }
  201.     /**
  202.      * Set nom
  203.      *
  204.      * @param string $nom
  205.      *
  206.      * @return Commande
  207.      */
  208.     public function setNom($nom)
  209.     {
  210.         $this->nom $nom;
  211.         return $this;
  212.     }
  213.     /**
  214.      * Get prenom
  215.      *
  216.      * @return string
  217.      */
  218.     public function getPrenom()
  219.     {
  220.         return $this->prenom;
  221.     }
  222.     /**
  223.      * Set prenom
  224.      *
  225.      * @param string $prenom
  226.      *
  227.      * @return Commande
  228.      */
  229.     public function setPrenom($prenom)
  230.     {
  231.         $this->prenom $prenom;
  232.         return $this;
  233.     }
  234.     /**
  235.      * Get email
  236.      *
  237.      * @return string
  238.      */
  239.     public function getEmail()
  240.     {
  241.         return $this->email;
  242.     }
  243.     /**
  244.      * Set email
  245.      *
  246.      * @param string $email
  247.      *
  248.      * @return Commande
  249.      */
  250.     public function setEmail($email)
  251.     {
  252.         $this->email $email;
  253.         return $this;
  254.     }
  255.     /**
  256.      * Get tel
  257.      *
  258.      * @return string
  259.      */
  260.     public function getTel()
  261.     {
  262.         return $this->tel;
  263.     }
  264.     /**
  265.      * Set tel
  266.      *
  267.      * @param string $tel
  268.      *
  269.      * @return Commande
  270.      */
  271.     public function setTel($tel)
  272.     {
  273.         $this->tel $tel;
  274.         return $this;
  275.     }
  276.     /**
  277.      * Get adresse
  278.      *
  279.      * @return string
  280.      */
  281.     public function getAdresse()
  282.     {
  283.         return $this->adresse;
  284.     }
  285.     /**
  286.      * Set adresse
  287.      *
  288.      * @param string $adresse
  289.      *
  290.      * @return Commande
  291.      */
  292.     public function setAdresse($adresse)
  293.     {
  294.         $this->adresse $adresse;
  295.         return $this;
  296.     }
  297.     /**
  298.      * Get complement
  299.      *
  300.      * @return string
  301.      */
  302.     public function getComplement()
  303.     {
  304.         return $this->complement;
  305.     }
  306.     /**
  307.      * Set complement
  308.      *
  309.      * @param string $complement
  310.      *
  311.      * @return Commande
  312.      */
  313.     public function setComplement($complement)
  314.     {
  315.         $this->complement $complement;
  316.         return $this;
  317.     }
  318.     /**
  319.      * Get codePostal
  320.      *
  321.      * @return string
  322.      */
  323.     public function getCodePostal()
  324.     {
  325.         return $this->codePostal;
  326.     }
  327.     /**
  328.      * Set codePostal
  329.      *
  330.      * @param string $codePostal
  331.      *
  332.      * @return Commande
  333.      */
  334.     public function setCodePostal($codePostal)
  335.     {
  336.         $this->codePostal $codePostal;
  337.         return $this;
  338.     }
  339.     /**
  340.      * Set sexe
  341.      *
  342.      * @param string $sexe
  343.      *
  344.      * @return Commande
  345.      */
  346.     public function setSexe($sexe)
  347.     {
  348.         $this->sexe $sexe;
  349.         return $this;
  350.     }
  351.     /**
  352.      * Get sexe
  353.      *
  354.      * @return string
  355.      */
  356.     public function getSexe()
  357.     {
  358.         return $this->sexe;
  359.     }
  360.     /**
  361.      * Set age
  362.      *
  363.      * @param string $age
  364.      *
  365.      * @return Commande
  366.      */
  367.     public function setAge($age)
  368.     {
  369.         $this->age $age;
  370.         return $this;
  371.     }
  372.     /**
  373.      * Get age
  374.      *
  375.      * @return string
  376.      */
  377.     public function getAge()
  378.     {
  379.         return $this->age;
  380.     }
  381.     /**
  382.      * Get horodateCreation
  383.      *
  384.      * @return datetime
  385.      */
  386.     public function getHorodateCreation()
  387.     {
  388.         return $this->horodateCreation;
  389.     }
  390.     /**
  391.      * Set horodateCreation
  392.      *
  393.      * @param datetime $horodateCreation
  394.      *
  395.      * @return Commande
  396.      */
  397.     public function setHorodateCreation($horodateCreation)
  398.     {
  399.         $this->horodateCreation $horodateCreation;
  400.         return $this;
  401.     }
  402.     /**
  403.      * Get specialite
  404.      *
  405.      * @return SpecialiteDocteur
  406.      */
  407.     public function getSpecialite()
  408.     {
  409.         return $this->specialite;
  410.     }
  411.     /**
  412.      * Set specialite
  413.      *
  414.      * @param SpecialiteDocteur $specialite
  415.      *
  416.      * @return Commande
  417.      */
  418.     public function setSpecialite(SpecialiteDocteur $specialite)
  419.     {
  420.         $this->specialite $specialite;
  421.         return $this;
  422.     }
  423.     /**
  424.      * Get symptome
  425.      *
  426.      * @return Symptome
  427.      */
  428.     public function getSymptome()
  429.     {
  430.         return $this->symptome;
  431.     }
  432.     /**
  433.      * Set symptome
  434.      *
  435.      * @param Symptome $symptome
  436.      *
  437.      * @return Commande
  438.      */
  439.     public function setSymptome($symptome)
  440.     {
  441.         $this->symptome $symptome;
  442.         return $this;
  443.     }
  444.     /**
  445.      * Get actif
  446.      *
  447.      * @return boolean
  448.      */
  449.     public function getActif()
  450.     {
  451.         return $this->actif;
  452.     }
  453.     /**
  454.      * Set actif
  455.      *
  456.      * @param bool $actif
  457.      *
  458.      * @return Commande
  459.      */
  460.     public function setActif($actif)
  461.     {
  462.         $this->actif $actif;
  463.         return $this;
  464.     }
  465.     /**
  466.      * @return mixed
  467.      */
  468.     public function getStripeCustomer()
  469.     {
  470.         return $this->stripeCustomer;
  471.     }
  472.     /**
  473.      * @param mixed $stripeCustomer
  474.      */
  475.     public function setStripeCustomer($stripeCustomer)
  476.     {
  477.         $this->stripeCustomer $stripeCustomer;
  478.     }
  479.     /**
  480.      * @return mixed
  481.      */
  482.     public function getPaymentMethod()
  483.     {
  484.         return $this->paymentMethod;
  485.     }
  486.     /**
  487.      * @param mixed $paymentMethod
  488.      */
  489.     public function setPaymentMethod($paymentMethod)
  490.     {
  491.         $this->paymentMethod $paymentMethod;
  492.     }
  493.     /**
  494.      * @return bool
  495.      */
  496.     public function getType(): ?string
  497.     {
  498.         return $this->type;
  499.     }
  500.     /**
  501.      * @param string $type
  502.      */
  503.     public function setType(string $type): void
  504.     {
  505.         $this->type $type;
  506.     }
  507.     /**
  508.      * @return Client
  509.      */
  510.     public function getClient(): ?Client
  511.     {
  512.         return $this->client;
  513.     }
  514.     /**
  515.      * @param Client $client
  516.      */
  517.     public function setClient(Client $client): void
  518.     {
  519.         $this->client $client;
  520.     }
  521.     /**
  522.      * @return ?string
  523.      */
  524.     public function getHubspotDealId(): ?string
  525.     {
  526.         return $this->hubspotDealId;
  527.     }
  528.     /**
  529.      * @param ?string $hubspotDealId
  530.      */
  531.     public function setHubspotDealId(?string $hubspotDealId): void
  532.     {
  533.         $this->hubspotDealId $hubspotDealId;
  534.     }
  535.     /**
  536.      * @return bool
  537.      */
  538.     public function isTraite(): bool
  539.     {
  540.         return $this->traite;
  541.     }
  542.     /**
  543.      * @param bool $traite
  544.      */
  545.     public function setTraite(bool $traite): void
  546.     {
  547.         $this->traite $traite;
  548.     }
  549.     /**
  550.      * @return bool
  551.      */
  552.     public function isConverted(): bool
  553.     {
  554.         return $this->converted;
  555.     }
  556.     /**
  557.      * @param bool $converted
  558.      */
  559.     public function setConverted(bool $converted): void
  560.     {
  561.         $this->converted $converted;
  562.     }
  563.     /**
  564.      * @return bool
  565.      */
  566.     public function isReminderSended(): bool
  567.     {
  568.         return $this->reminderSended;
  569.     }
  570.     /**
  571.      * @param bool $reminderSended
  572.      */
  573.     public function setReminderSended(bool $reminderSended): void
  574.     {
  575.         $this->reminderSended $reminderSended;
  576.     }
  577.     /**
  578.      * @return string
  579.      */
  580.     public function getHubspotContactId(): ?string
  581.     {
  582.         return $this->hubspotContactId;
  583.     }
  584.     /**
  585.      * @param string $hubspotContactId
  586.      */
  587.     public function setHubspotContactId(?string $hubspotContactId): void
  588.     {
  589.         $this->hubspotContactId $hubspotContactId;
  590.     }
  591. }