src/Entity/Intervention.php line 64

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use App\Entity\Card;
  5. use App\Entity\SpecialiteDocteur;
  6. use App\Entity\Docteur;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use ApiPlatform\Core\Annotation\ApiResource;
  10. use Symfony\Component\Validator\Constraints as Assert;
  11. use App\Repository\InterventionRepository;
  12. use ApiPlatform\Core\Annotation\ApiFilter;
  13. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  14. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter;
  15. use ApiPlatform\Serializer\Filter\PropertyFilter;
  16. /**
  17.  * Intervention
  18.  *
  19.  * @ORM\Table()
  20.  * @ORM\Entity(repositoryClass=InterventionRepository::class)
  21.  * @ApiResource(
  22.  *     attributes={
  23.  *       "filters"={
  24.  *          "intervention.order",
  25.  *          "intervention.search",
  26.  *          "intervention.boolean",
  27.  *          "intervention.date",
  28.  *          "intervention.date.after",
  29.  *          "intervention.date.before",
  30.  *          "intervention.boolean.equal"
  31.  *       },
  32.  *       "force_eager"=false,
  33.  *       "normalization_context"={"groups"={"docteur", "client", "user", "read", "media", "write"}},
  34.  *       "denormalization_context"={"groups"={"read", "user", "media"}}
  35.  *     },
  36.  *     collectionOperations={
  37.  *        "get"={"method"="GET"},
  38.  *        "post"={"method"="POST", "route_name"="api_interventions_post_collection"},
  39.  *        "post_visio"={"method"="POST", "route_name"="api_interventions_post_visio"}
  40.  *     },
  41.  *     itemOperations={
  42.  *        "get"={"method"="GET"},
  43.  *        "put"={"method"="PUT"},
  44.  *        "confirmation"={"method"="PUT", "route_name"="api_interventions_confirmation"},
  45.  *        "recu"={"method"="PUT", "route_name"="api_interventions_recu"},
  46.  *        "cancel"={"method"="PUT", "route_name"="api_interventions_cancel"},
  47.  *        "cancel_by_docteur"={"method"="PUT", "route_name"="api_interventions_cancel_by_docteur"},
  48.  *        "doctorNotFound"={"method"="PUT", "route_name"="api_interventions_notfound"}
  49.  *     }
  50.  * )
  51.  * @ApiFilter(SearchFilter::class, properties={
  52.  *     "numeroReference": "exact",
  53.  *     "docteur.id": "exact",
  54.  *     "horodateCreation": "exact",
  55.  *     "modeIntervention": "exact"
  56.  * })
  57.  * @ApiFilter(DateFilter::class, properties={"horodateCreation"})
  58.  */
  59. class Intervention
  60. {
  61.     const ETAT_NOT_FOUND "not_found";
  62.     const ETAT_SCHEDULED "scheduled";
  63.     const ETAT_SCHEDULED_ACCEPTED "scheduled_accepted";
  64.     const ETAT_ISSUED "emis";
  65.     const ETAT_INIT_CONSULTATION "initConsultation";
  66.     const ETAT_END "endConsultation";
  67.     const ETAT_CANCEL "cancel";
  68.     const ETAT_VALIDATE "validation";
  69.     const TYPE_WEB "web"//old
  70.     //new type
  71.     const TYPE_VISIO "visio";
  72.     const TYPE_MOBILE "mobile";
  73.     const TYPE_DOMICILE "domicile";
  74.     // add statuts for mike => READY TO GO
  75.     /**
  76.      * @var int
  77.      *
  78.      * @ORM\Column(name="id", type="integer")
  79.      * @ORM\Id
  80.      * @ORM\GeneratedValue(strategy="AUTO")
  81.      *
  82.      * @Groups({"read"})
  83.      */
  84.     private $id;
  85.     /**
  86.      * @var string
  87.      *
  88.      * @ORM\Column(name="numeroReference", type="string", length=100)
  89.      *
  90.      * @Assert\NotBlank()
  91.      * @Groups({"read"})
  92.      */
  93.     private $numeroReference;
  94.     /**
  95.      * @var string
  96.      * @ORM\Column(name="redirectLeMedecin", type="string", nullable=true)
  97.      ** @Groups({"read"})
  98.      */
  99.     private $redirectLeMedecin '';
  100.     /**
  101.      * @var string
  102.      *
  103.      * @ORM\Column(name="chargeToken", type="string", length=50, nullable=true)
  104.      */
  105.     private $chargeToken;
  106.     /**
  107.      * @var string
  108.      *
  109.      * @ORM\Column(name="etat", type="string", length=100)
  110.      *
  111.      * @Assert\NotBlank()
  112.      * @Groups({"read"})
  113.      */
  114.     private $etat;
  115.     /**
  116.      * @var string
  117.      *
  118.      * @ORM\Column(type="string", length=250, nullable=true)
  119.      * @Groups({"read"})
  120.      */
  121.     private $motifEtatAnnule;
  122.     /**
  123.      * @var string
  124.      *
  125.      * @ORM\Column(name="typeIntervention", type="string", length=20)
  126.      *
  127.      * @Assert\NotBlank()
  128.      * @Groups({"read"})
  129.      */
  130.     private $typeIntervention;
  131.     /**
  132.      * @var string
  133.      *
  134.      * @ORM\Column(name="modeIntervention", type="string", length=20)
  135.      *
  136.      * @Assert\NotBlank()
  137.      * @Groups({"read"})
  138.      */
  139.     private $modeIntervention;
  140.     /**
  141.      * @var \DateTime
  142.      *
  143.      * @ORM\Column(name="horodateIntervention", type="datetime")
  144.      *
  145.      * @Assert\NotBlank()
  146.      * @Groups({"read"})
  147.      */
  148.     private $horodateIntervention;
  149.     /**
  150.      * @var string
  151.      *
  152.      * @ORM\Column(type="string", length=255)
  153.      *
  154.      * @Assert\NotBlank()
  155.      * @Groups({"read"})
  156.      */
  157.     private $adresse;
  158.     /**
  159.      * @var string
  160.      *
  161.      * @ORM\Column(type="string", length=10, nullable=true)
  162.      *
  163.      * @Groups({"read"})
  164.      */
  165.     private $codePostal;
  166.     /**
  167.      * @var string
  168.      *
  169.      * @ORM\Column(type="string", length=50)
  170.      *
  171.      * @Assert\NotBlank()
  172.      * @Groups({"read"})
  173.      */
  174.     private $pays;
  175.     /**
  176.      * @var text
  177.      *
  178.      * @ORM\Column(type="text", nullable=true)
  179.      * @Groups({"read"})
  180.      */
  181.     private $complement;
  182.     /**
  183.      * @var string
  184.      *
  185.      * @ORM\Column(name="sexe", type="string", length=20, nullable=true)
  186.      * @Groups({"read"})
  187.      */
  188.     private $sexe;
  189.     /**
  190.      * @var string
  191.      *
  192.      * @ORM\Column(name="age", type="integer")
  193.      *
  194.      * @Assert\NotBlank()
  195.      * @Groups({"read"})
  196.      */
  197.     private $age;
  198.     /**
  199.      * @var int
  200.      *
  201.      * @ORM\Column(name="prix", type="float")
  202.      *
  203.      * @Assert\NotBlank()
  204.      * @Groups({"read"})
  205.      */
  206.     private $prix;
  207.     /**
  208.      * @var int
  209.      *
  210.      * @ORM\Column(name="supplement", type="float")
  211.      *
  212.      * @Assert\NotBlank()
  213.      * @Groups({"read"})
  214.      */
  215.     private $supplement;
  216.     /**
  217.      * @var string
  218.      *
  219.      * @ORM\Column(name="typeDay", type="string", length=20, nullable=true)
  220.      * @Groups({"read"})
  221.      */
  222.     private $typeDay;
  223.     /**
  224.      * @var text
  225.      *
  226.      * @ORM\Column(name="typeHeure", type="string", length=20, nullable=true)
  227.      * @Groups({"read"})
  228.      */
  229.     private $typeHeure;
  230.     /**
  231.      * @var text
  232.      *
  233.      * @ORM\Column(name="symptomes", type="string", length=100, nullable=true)
  234.      * @Groups({"read"})
  235.      */
  236.     private $symptomes;
  237.     /**
  238.      * @var text
  239.      *
  240.      * @ORM\Column(name="commentaires", type="text", nullable=true)
  241.      * @Groups({"read"})
  242.      */
  243.     private $commentaires;
  244.     /**
  245.      * @var int
  246.      *
  247.      * @ORM\Column(name="noteIntervention", type="integer")
  248.      *
  249.      * @Assert\NotBlank()
  250.      * @Groups({"read"})
  251.      */
  252.     private $noteIntervention;
  253.     /**
  254.      * @var int
  255.      *
  256.      * @ORM\Column(name="commission", type="integer")
  257.      * @Groups({"read"})
  258.      */
  259.     private $commission;
  260.     /**
  261.      * @var int
  262.      *
  263.      * @ORM\Column(name="delaiAttente", type="integer")
  264.      *
  265.      * @Assert\NotBlank()
  266.      * @Groups({"read"})
  267.      */
  268.     private $delaiAttente;
  269.     /**
  270.      * @var int
  271.      *
  272.      * @ORM\Column(name="dureeIntervention", type="integer")
  273.      *
  274.      * @Assert\NotBlank()
  275.      * @Groups({"read"})
  276.      */
  277.     private $dureeIntervention;
  278.     /**
  279.      * @var text
  280.      *
  281.      * @ORM\Column(name="motifIntervention", type="text", nullable=true)
  282.      * @Groups({"read"})
  283.      */
  284.     private $motifIntervention;
  285.     /**
  286.      * @var datetime
  287.      *
  288.      * @ORM\Column(name="horodateCreation", type="datetime")
  289.      *
  290.      * @Assert\NotBlank()
  291.      * @Groups({"read"})
  292.      */
  293.     private $horodateCreation;
  294.     /**
  295.      * @var
  296.      *
  297.      * @ORM\ManyToOne(targetEntity="App\Entity\Card")
  298.      * @ORM\JoinColumn(onDelete="SET NULL")
  299.      * @Groups({"read"})
  300.      */
  301.     private $carteBancaire;
  302.     /**
  303.      * @var Docteur
  304.      *
  305.      * @ORM\ManyToOne(targetEntity="App\Entity\Docteur", cascade={"persist"})
  306.      * @ORM\JoinColumn(onDelete="SET NULL")
  307.      * @Groups({"docteur"})
  308.      */
  309.     private $docteur;
  310.     /**
  311.      * @var Client
  312.      *
  313.      * @ORM\ManyToOne(targetEntity=Client::class, cascade={"persist"})
  314.      * @ORM\JoinColumn(onDelete="SET NULL")
  315.      * @Groups({"client", "read"})
  316.      */
  317.     private $client;
  318.     /**
  319.      * @var SpecialiteDocteur
  320.      *
  321.      * @ORM\ManyToOne(targetEntity=SpecialiteDocteur::class, cascade={"persist"})
  322.      * @ORM\JoinColumn(onDelete="SET NULL")
  323.      * @Groups({"read"})
  324.      */
  325.     private $specialite;
  326.     /***
  327.      * Still in use. A REMOVE
  328.      *
  329.      * @ORM\Column(name="specialiteId", type="integer")
  330.      * @Groups({"read"})
  331.      */
  332.     private $specialiteId;
  333.     /**
  334.      * @var Commande
  335.      *
  336.      * @ORM\ManyToOne(targetEntity=Commande::class, cascade={"persist"})
  337.      * @ORM\JoinColumn(onDelete="SET NULL")
  338.      * @Groups({"read"})
  339.      */
  340.     private $commande;
  341.     /**
  342.      * @var bool
  343.      *
  344.      * @ORM\Column(name="actif", type="boolean")
  345.      * @Groups({"read"})
  346.      */
  347.     private $actif;
  348.     /**
  349.      * Represente
  350.      *
  351.      * @ORM\Column(name="current", type="boolean")
  352.      * @Groups({"read"})
  353.      */
  354.     private $current false;
  355.     /**
  356.      * Represente si l'intervention à été traité par nos équipes
  357.      *
  358.      * @ORM\Column(name="traite", type="boolean")
  359.      * @Groups({"read"})
  360.      */
  361.     private $traite false;
  362.     /**
  363.      * Represente si l'intervention à été traité par nos équipes
  364.      *
  365.      * @ORM\Column(name="smsReminder", type="boolean")
  366.      * @Groups({"read"})
  367.      */
  368.     private $smsReminder false;
  369.     /**
  370.      * Represente si l'intervention à été traité par nos équipes
  371.      *
  372.      * @ORM\Column(name="smsNotFound", type="boolean")
  373.      * @Groups({"read"})
  374.      */
  375.     private $smsNotFound false;
  376.     /**
  377.      * Represente si l'intervention à été traité par nos équipes
  378.      *
  379.      * @ORM\Column(name="notificationsSent", type="boolean")
  380.      * @Groups({"read"})
  381.      */
  382.     private $notificationsSent false;
  383.     /**
  384.      * Represente si l'intervention à été traité par nos équipes
  385.      *
  386.      * @ORM\Column(name="emailReminder", type="boolean")
  387.      * @Groups({"read"})
  388.      */
  389.     private $emailReminder false;
  390.     /**
  391.      * Represente si l'intervention à été traité par nos équipes
  392.      *
  393.      * @ORM\Column(name="smsEndTeleconsultation", type="boolean")
  394.      * @Groups({"read"})
  395.      */
  396.     private $smsEndTeleconsultation false;
  397.     /**
  398.      * Represente si l'intervention à été traité par nos équipes
  399.      *
  400.      * @ORM\Column(name="patient_abs", type="boolean")
  401.      * @Groups({"read"})
  402.      */
  403.     private $patientAbs false;
  404.     /**
  405.      * @var text
  406.      *
  407.      * @ORM\Column(name="validated_timestamp", type="datetime", nullable=true)
  408.      * @Groups({"read"})
  409.      */
  410.     private $validatedTimestamp;
  411.     /**
  412.      * @ORM\OneToMany(targetEntity=Ordonnance::class, mappedBy="intervention")
  413.      */
  414.     private $ordonnances;
  415.     /**
  416.      * @ORM\OneToMany(targetEntity=FeuilleSoin::class, mappedBy="intervention")
  417.      */
  418.     private $feuilles;
  419.     /**
  420.      * @ORM\OneToMany(targetEntity=ArretTravail::class, mappedBy="intervention")
  421.      */
  422.     private $arrets;
  423.     /**
  424.      * Constructor of Intervention Entity
  425.      */
  426.     public function __construct()
  427.     {
  428.         $this->numeroReference uniqid();
  429.         $this->etat 'emis';
  430.         $this->typeIntervention 'mobile';
  431.         $this->modeIntervention 'physique';
  432.         $this->horodateIntervention = new \DateTime();
  433.         $this->pays 'France';
  434.         $this->delaiAttente 0// Minutes
  435.         $this->dureeIntervention 0// Minutes
  436.         $this->commission 0;
  437.         $this->specialiteId 0;
  438.         $this->age 0;
  439.         $this->noteIntervention 5;
  440.         $this->horodateCreation = new \DateTime;
  441.         $this->actif true;
  442.         $this->ordonnances = new ArrayCollection();
  443.         $this->feuilles = new ArrayCollection();
  444.         $this->arrets = new ArrayCollection();
  445.     }
  446.     public function __toString()
  447.     {
  448.         return ($this->getNumeroReference()) ? $this->getNumeroReference() : '';
  449.     }
  450.     /**
  451.      * Get id
  452.      *
  453.      * @return integer
  454.      */
  455.     public function getId()
  456.     {
  457.         return $this->id;
  458.     }
  459.     /**
  460.      * Get numeroReference
  461.      *
  462.      * @return string
  463.      */
  464.     public function getNumeroReference()
  465.     {
  466.         return $this->numeroReference;
  467.     }
  468.     /**
  469.      * Set numeroReference
  470.      *
  471.      * @param string $numeroReference
  472.      *
  473.      * @return Intervention
  474.      */
  475.     public function setNumeroReference($numeroReference)
  476.     {
  477.         $this->numeroReference $numeroReference;
  478.         return $this;
  479.     }
  480.     /**
  481.      * Get chargeToken
  482.      *
  483.      * @return string
  484.      */
  485.     public function getChargeToken()
  486.     {
  487.         return $this->chargeToken;
  488.     }
  489.     /**
  490.      * Set chargeToken
  491.      *
  492.      * @param string $chargeToken
  493.      *
  494.      * @return Intervention
  495.      */
  496.     public function setChargeToken($chargeToken)
  497.     {
  498.         $this->chargeToken $chargeToken;
  499.         return $this;
  500.     }
  501.     /**
  502.      * Get etat
  503.      *
  504.      * @return string
  505.      */
  506.     public function getEtat()
  507.     {
  508.         return $this->etat;
  509.     }
  510.     /**
  511.      * Set etat
  512.      *
  513.      * @param string $etat
  514.      *
  515.      * @return Intervention
  516.      */
  517.     public function setEtat($etat)
  518.     {
  519.         $this->etat $etat;
  520.         return $this;
  521.     }
  522.     /**
  523.      * Get motifEtatAnnule
  524.      *
  525.      * @return string
  526.      */
  527.     public function getMotifEtatAnnule()
  528.     {
  529.         return $this->motifEtatAnnule;
  530.     }
  531.     /**
  532.      * Set motifEtatAnnule
  533.      *
  534.      * @param string $motifEtatAnnule
  535.      *
  536.      * @return Intervention
  537.      */
  538.     public function setMotifEtatAnnule($motifEtatAnnule)
  539.     {
  540.         $this->motifEtatAnnule $motifEtatAnnule;
  541.         return $this;
  542.     }
  543.     /**
  544.      * Get typeIntervention
  545.      *
  546.      * @return string
  547.      */
  548.     public function getTypeIntervention()
  549.     {
  550.         return $this->typeIntervention;
  551.     }
  552.     /**
  553.      * Set typeIntervention
  554.      *
  555.      * @param string $typeIntervention
  556.      *
  557.      * @return Intervention
  558.      */
  559.     public function setTypeIntervention($typeIntervention)
  560.     {
  561.         $this->typeIntervention $typeIntervention;
  562.         return $this;
  563.     }
  564.     /**
  565.      * Get modeIntervention
  566.      *
  567.      * @return string
  568.      */
  569.     public function getModeIntervention()
  570.     {
  571.         return $this->modeIntervention;
  572.     }
  573.     /**
  574.      * Set modeIntervention
  575.      *
  576.      * @param string $modeIntervention
  577.      *
  578.      * @return Intervention
  579.      */
  580.     public function setModeIntervention($modeIntervention)
  581.     {
  582.         $this->modeIntervention $modeIntervention;
  583.         return $this;
  584.     }
  585.     /**
  586.      * Get horodateIntervention
  587.      *
  588.      * @return \DateTime
  589.      */
  590.     public function getHorodateIntervention()
  591.     {
  592.         return $this->horodateIntervention;
  593.     }
  594.     /**
  595.      * Set horodateIntervention
  596.      *
  597.      * @param \DateTime $horodateIntervention
  598.      *
  599.      * @return Intervention
  600.      */
  601.     public function setHorodateIntervention($horodateIntervention)
  602.     {
  603.         $this->horodateIntervention $horodateIntervention;
  604.         return $this;
  605.     }
  606.     /**
  607.      * Get getHorodateInterventionInfoString
  608.      *
  609.      * @return string
  610.      * @Groups({"read"})
  611.      */
  612.     public function getHorodateInterventionInfoString()
  613.     {
  614.         return $this->horodateIntervention->format('Y-m-d');
  615.     }
  616.     /**
  617.      * Get getHorodateInterventionInfoString
  618.      *
  619.      * @return string
  620.      * @Groups({"read"})
  621.      */
  622.     public function getHorodateInterventionHour()
  623.     {
  624.         return $this->horodateIntervention->format('H:i');
  625.     }
  626.     /**
  627.      * Get getHorodateInterventionTimeInfoString
  628.      *
  629.      * @return \DateTime
  630.      * @Groups({"read"})
  631.      */
  632.     public function getHorodateInterventionTimeInfoString()
  633.     {
  634.         return $this->horodateIntervention->format('c');
  635.     }
  636.     /**
  637.      * Get adresse
  638.      *
  639.      * @return string
  640.      */
  641.     public function getAdresse()
  642.     {
  643.         return $this->adresse;
  644.     }
  645.     /**
  646.      * Set adresse
  647.      *
  648.      * @param string $adresse
  649.      *
  650.      * @return Intervention
  651.      */
  652.     public function setAdresse($adresse)
  653.     {
  654.         $this->adresse $adresse;
  655.         return $this;
  656.     }
  657.     /**
  658.      * Get codePostal
  659.      *
  660.      * @return string
  661.      */
  662.     public function getCodePostal()
  663.     {
  664.         return $this->codePostal;
  665.     }
  666.     /**
  667.      * Set codePostal
  668.      *
  669.      * @param string $codePostal
  670.      *
  671.      * @return Intervention
  672.      */
  673.     public function setCodePostal($codePostal)
  674.     {
  675.         $this->codePostal $codePostal;
  676.         return $this;
  677.     }
  678.     /**
  679.      * Get pays
  680.      *
  681.      * @return string
  682.      */
  683.     public function getPays()
  684.     {
  685.         return $this->pays;
  686.     }
  687.     /**
  688.      * Set pays
  689.      *
  690.      * @param string $pays
  691.      *
  692.      * @return Intervention
  693.      */
  694.     public function setPays($pays)
  695.     {
  696.         $this->pays $pays;
  697.         return $this;
  698.     }
  699.     /**
  700.      * Get complement
  701.      *
  702.      * @return text
  703.      */
  704.     public function getComplement()
  705.     {
  706.         return $this->complement;
  707.     }
  708.     /**
  709.      * Set complement
  710.      *
  711.      * @param string $complement
  712.      *
  713.      * @return Intervention
  714.      */
  715.     public function setComplement($complement)
  716.     {
  717.         $this->complement $complement;
  718.         return $this;
  719.     }
  720.     /**
  721.      * Set sexe
  722.      *
  723.      * @param string $sexe
  724.      *
  725.      * @return Intervention
  726.      */
  727.     public function setSexe($sexe)
  728.     {
  729.         $this->sexe $sexe;
  730.         return $this;
  731.     }
  732.     /**
  733.      * Get sexe
  734.      *
  735.      * @return string
  736.      */
  737.     public function getSexe()
  738.     {
  739.         return $this->sexe;
  740.     }
  741.     /**
  742.      * Set age
  743.      *
  744.      * @param string $age
  745.      *
  746.      * @return Intervention
  747.      */
  748.     public function setAge($age)
  749.     {
  750.         $this->age $age;
  751.         return $this;
  752.     }
  753.     /**
  754.      * Get age
  755.      *
  756.      * @return string
  757.      */
  758.     public function getAge()
  759.     {
  760.         return $this->age;
  761.     }
  762.     /**
  763.      * Get prix
  764.      *
  765.      * @return integer
  766.      */
  767.     public function getPrix()
  768.     {
  769.         return $this->prix;
  770.     }
  771.     /**
  772.      * Set prix
  773.      *
  774.      * @param int $prix
  775.      *
  776.      * @return Intervention
  777.      */
  778.     public function setPrix($prix)
  779.     {
  780.         $this->prix $prix;
  781.         return $this;
  782.     }
  783.     /**
  784.      * Get supplement
  785.      *
  786.      * @return float
  787.      */
  788.     public function getSupplement()
  789.     {
  790.         return $this->supplement;
  791.     }
  792.     /**
  793.      * Set supplement
  794.      *
  795.      * @param float $supplement
  796.      *
  797.      * @return Intervention
  798.      */
  799.     public function setSupplement($supplement)
  800.     {
  801.         $this->supplement $supplement;
  802.         return $this;
  803.     }
  804.     /**
  805.      * Get typeDay
  806.      *
  807.      * @return string
  808.      */
  809.     public function getTypeDay()
  810.     {
  811.         return $this->typeDay;
  812.     }
  813.     /**
  814.      * Set typeDay
  815.      *
  816.      * @param string $typeDay
  817.      *
  818.      * @return Intervention
  819.      */
  820.     public function setTypeDay($typeDay)
  821.     {
  822.         $this->typeDay $typeDay;
  823.         return $this;
  824.     }
  825.     /**
  826.      * Get typeHeure
  827.      *
  828.      * @return string
  829.      */
  830.     public function getTypeHeure()
  831.     {
  832.         return $this->typeHeure;
  833.     }
  834.     /**
  835.      * Set typeHeure
  836.      *
  837.      * @param string $typeHeure
  838.      *
  839.      * @return Intervention
  840.      */
  841.     public function setTypeHeure($typeHeure)
  842.     {
  843.         $this->typeHeure $typeHeure;
  844.         return $this;
  845.     }
  846.     /**
  847.      * Get symptomes
  848.      *
  849.      * @return text
  850.      */
  851.     public function getSymptomes()
  852.     {
  853.         return $this->symptomes;
  854.     }
  855.     /**
  856.      * Set symptomes
  857.      *
  858.      * @param text $symptomes
  859.      *
  860.      * @return Intervention
  861.      */
  862.     public function setSymptomes($symptomes)
  863.     {
  864.         $this->symptomes $symptomes;
  865.         return $this;
  866.     }
  867.     /**
  868.      * Get commentaires
  869.      *
  870.      * @return text
  871.      */
  872.     public function getCommentaires()
  873.     {
  874.         return $this->commentaires;
  875.     }
  876.     /**
  877.      * Set commentaires
  878.      *
  879.      * @param text $commentaires
  880.      *
  881.      * @return Intervention
  882.      */
  883.     public function setCommentaires($commentaires)
  884.     {
  885.         $this->commentaires $commentaires;
  886.         return $this;
  887.     }
  888.     /**
  889.      * Get noteIntervention
  890.      *
  891.      * @return integer
  892.      */
  893.     public function getNoteIntervention()
  894.     {
  895.         return $this->noteIntervention;
  896.     }
  897.     /**
  898.      * Set noteIntervention
  899.      *
  900.      * @param int $noteIntervention
  901.      *
  902.      * @return Intervention
  903.      */
  904.     public function setNoteIntervention($noteIntervention)
  905.     {
  906.         $this->noteIntervention $noteIntervention;
  907.         return $this;
  908.     }
  909.     /**
  910.      * Get delaiAttente
  911.      *
  912.      * @return integer
  913.      */
  914.     public function getDelaiAttente()
  915.     {
  916.         return $this->delaiAttente;
  917.     }
  918.     /**
  919.      * Set delaiAttente
  920.      *
  921.      * @param int $delaiAttente
  922.      *
  923.      * @return Intervention
  924.      */
  925.     public function setDelaiAttente($delaiAttente)
  926.     {
  927.         $this->delaiAttente $delaiAttente;
  928.         return $this;
  929.     }
  930.     /**
  931.      * Get dureeIntervention
  932.      *
  933.      * @return integer
  934.      */
  935.     public function getDureeIntervention()
  936.     {
  937.         return $this->dureeIntervention;
  938.     }
  939.     /**
  940.      * Set dureeIntervention
  941.      *
  942.      * @param int $dureeIntervention
  943.      *
  944.      * @return Intervention
  945.      */
  946.     public function setDureeIntervention($dureeIntervention)
  947.     {
  948.         $this->dureeIntervention $dureeIntervention;
  949.         return $this;
  950.     }
  951.     /**
  952.      * Get commission
  953.      *
  954.      * @return integer
  955.      */
  956.     public function getCommission()
  957.     {
  958.         return $this->commission;
  959.     }
  960.     /**
  961.      * Set commission
  962.      *
  963.      * @param int $commission
  964.      *
  965.      * @return Intervention
  966.      */
  967.     public function setCommission($commission)
  968.     {
  969.         $this->commission $commission;
  970.         return $this;
  971.     }
  972.     /**
  973.      * Get motifIntervention
  974.      *
  975.      * @return text
  976.      */
  977.     public function getMotifIntervention()
  978.     {
  979.         return $this->motifIntervention;
  980.     }
  981.     /**
  982.      * Set motifIntervention
  983.      *
  984.      * @param text $motifIntervention
  985.      *
  986.      * @return Intervention
  987.      */
  988.     public function setMotifIntervention($motifIntervention)
  989.     {
  990.         $this->motifIntervention $motifIntervention;
  991.         return $this;
  992.     }
  993.     /**
  994.      * Get horodateCreation
  995.      *
  996.      * @return \DateTime
  997.      */
  998.     public function getHorodateCreation()
  999.     {
  1000.         return $this->horodateCreation;
  1001.     }
  1002.     /**
  1003.      * Set horodateCreation
  1004.      *
  1005.      * @param |DateTime $horodateCreation
  1006.      *
  1007.      * @return Intervention
  1008.      */
  1009.     public function setHorodateCreation($horodateCreation)
  1010.     {
  1011.         $this->horodateCreation $horodateCreation;
  1012.         return $this;
  1013.     }
  1014.     /**
  1015.      * Get getHorodateCreationInfoString
  1016.      *
  1017.      * @return \DateTime
  1018.      * @Groups({"read"})
  1019.      */
  1020.     public function getHorodateCreationInfoString()
  1021.     {
  1022.         return $this->horodateCreation->format('Y-m-d');
  1023.     }
  1024.     /**
  1025.      * Get getHorodateCreationTimeInfoString
  1026.      *
  1027.      * @return \DateTime
  1028.      * @Groups({"read"})
  1029.      */
  1030.     public function getHorodateCreationTimeInfoString()
  1031.     {
  1032.         return $this->horodateCreation->format('c');
  1033.     }
  1034.     /**
  1035.      * Get carteBancaire
  1036.      *
  1037.      * @return Card
  1038.      */
  1039.     public function getCarteBancaire()
  1040.     {
  1041.         return $this->carteBancaire;
  1042.     }
  1043.     /**
  1044.      * Set carteBancaire
  1045.      *
  1046.      * @param CarteBancaire $carteBancaire
  1047.      *
  1048.      * @return Intervention
  1049.      */
  1050.     public function setCarteBancaire($carteBancaire)
  1051.     {
  1052.         $this->carteBancaire $carteBancaire;
  1053.         return $this;
  1054.     }
  1055.     /**
  1056.      * Get docteur
  1057.      *
  1058.      * @return Docteur
  1059.      */
  1060.     public function getDocteur()
  1061.     {
  1062.         return $this->docteur;
  1063.     }
  1064.     /**
  1065.      * Set docteur
  1066.      *
  1067.      * @param Docteur $docteur
  1068.      *
  1069.      * @return Intervention
  1070.      */
  1071.     public function setDocteur($docteur)
  1072.     {
  1073.         $this->docteur $docteur;
  1074.         return $this;
  1075.     }
  1076.     /**
  1077.      * Get client
  1078.      *
  1079.      * @return Client
  1080.      */
  1081.     public function getClient()
  1082.     {
  1083.         return $this->client;
  1084.     }
  1085.     /**
  1086.      * Set client
  1087.      *
  1088.      * @param Client $client
  1089.      *
  1090.      * @return Intervention
  1091.      */
  1092.     public function setClient($client)
  1093.     {
  1094.         $this->client $client;
  1095.         return $this;
  1096.     }
  1097.     /**
  1098.      * Get specialite
  1099.      *
  1100.      * @return SpecialiteDocteur
  1101.      */
  1102.     public function getSpecialite()
  1103.     {
  1104.         return $this->specialite;
  1105.     }
  1106.     /**
  1107.      * Set specialite
  1108.      *
  1109.      * @param Client $specialite
  1110.      *
  1111.      * @return SpecialiteDocteur
  1112.      */
  1113.     public function setSpecialite(SpecialiteDocteur $specialite)
  1114.     {
  1115.         $this->specialite $specialite;
  1116.         return $this;
  1117.     }
  1118.     /**
  1119.      * Get specialiteId
  1120.      *
  1121.      * @return ArrayCollection
  1122.      */
  1123.     public function getSpecialiteId()
  1124.     {
  1125.         return $this->specialiteId;
  1126.     }
  1127.     /**
  1128.      * Set specialiteId
  1129.      *
  1130.      * @param $specialiteId
  1131.      *
  1132.      * @return Intervention
  1133.      */
  1134.     public function setSpecialiteId($specialiteId)
  1135.     {
  1136.         $this->specialiteId $specialiteId;
  1137.         return $this;
  1138.     }
  1139.     /**
  1140.      * Get commande
  1141.      *
  1142.      * @return Commande
  1143.      */
  1144.     public function getCommande()
  1145.     {
  1146.         return $this->commande;
  1147.     }
  1148.     /**
  1149.      * Set commande
  1150.      *
  1151.      * @param $commande
  1152.      *
  1153.      * @return Intervention
  1154.      */
  1155.     public function setCommande($commande)
  1156.     {
  1157.         $this->commande $commande;
  1158.         return $this;
  1159.     }
  1160.     /**
  1161.      * Get actif
  1162.      *
  1163.      * @return boolean
  1164.      */
  1165.     public function getActif()
  1166.     {
  1167.         return $this->actif;
  1168.     }
  1169.     /**
  1170.      * Set actif
  1171.      *
  1172.      * @param bool $actif
  1173.      *
  1174.      * @return Intervention
  1175.      */
  1176.     public function setActif($actif)
  1177.     {
  1178.         $this->actif $actif;
  1179.         return $this;
  1180.     }
  1181.     /**
  1182.      * @return mixed
  1183.      */
  1184.     public function getTraite()
  1185.     {
  1186.         return $this->traite;
  1187.     }
  1188.     /**
  1189.      * @param mixed $traite
  1190.      */
  1191.     public function setTraite($traite)
  1192.     {
  1193.         $this->traite $traite;
  1194.     }
  1195.     /**
  1196.      * Maybe put in a service
  1197.      */
  1198.     public function getCalculatedPrice() {
  1199.         $date $this->getHorodateCreation();
  1200.         $date->setTimezone(new \DateTimeZone('Europe/Paris'));
  1201.         $hour $date->format('H');
  1202.         if ($this->isWeekend($date) || $this->isHoliday($date)) {
  1203.             if($hour >= 8  && $hour 20)
  1204.                 return 60;
  1205.             elseif($hour >= 20)
  1206.                 return 90;
  1207.             else
  1208.                 return 125;
  1209.         }
  1210.         if($hour >= 8  && $hour 20)
  1211.             return 55;
  1212.         elseif($hour >= 20)
  1213.             return 75;
  1214.         else
  1215.             return 110;
  1216.     }
  1217.     private function isWeekend(\DateTime $date) {
  1218.         return (date('N',$date->getTimestamp()) >= 6);
  1219.     }
  1220.     /**
  1221.      * @param \DateTime $date
  1222.      * @return bool
  1223.      */
  1224.     private function isHoliday(\DateTime $date) {
  1225.         $date_timestamp $date->getTimestamp();
  1226.         $year $date->format('Y');
  1227.         $easterDate  easter_date($year);
  1228.         $easterDay   date('j'$easterDate);
  1229.         $easterMonth date('n'$easterDate);
  1230.         $easterYear   date('Y'$easterDate);
  1231.         $holidays = [
  1232.             // Dates fixes
  1233.             mktime(0001,  1,  $year),  // 1er janvier
  1234.             mktime(0005,  1,  $year),  // Fête du travail
  1235.             mktime(0005,  8,  $year),  // Victoire des alliés
  1236.             mktime(0007,  14$year),  // Fête nationale
  1237.             mktime(0008,  15$year),  // Assomption
  1238.             mktime(000111,  $year),  // Toussaint
  1239.             mktime(0001111$year),  // Armistice
  1240.             mktime(0001225$year),  // Noel
  1241.             // Dates variables
  1242.             mktime(000$easterMonth$easterDay 1,  $easterYear),
  1243.             mktime(000$easterMonth$easterDay 39$easterYear),
  1244.             mktime(000$easterMonth$easterDay 50$easterYear),
  1245.         ];
  1246.         return in_array($date_timestamp$holidays);
  1247.     }
  1248.     /**
  1249.      * @return mixed
  1250.      */
  1251.     public function getCurrent()
  1252.     {
  1253.         return $this->current;
  1254.     }
  1255.     /**
  1256.      * @param mixed $current
  1257.      */
  1258.     public function setCurrent($current)
  1259.     {
  1260.         $this->current $current;
  1261.     }
  1262.     /**
  1263.      * @return
  1264.      */
  1265.     public function getValidatedTimestamp()
  1266.     {
  1267.         return $this->validatedTimestamp;
  1268.     }
  1269.     /**
  1270.      * @param $validatedTimestamp
  1271.      */
  1272.     public function setValidatedTimestamp($validatedTimestamp)
  1273.     {
  1274.         $this->validatedTimestamp $validatedTimestamp;
  1275.     }
  1276.     /**
  1277.      * @return string
  1278.      */
  1279.     public function getRedirectLeMedecin()
  1280.     {
  1281.         return $this->redirectLeMedecin;
  1282.     }
  1283.     /**
  1284.      * @param string $redirectLeMedecin
  1285.      */
  1286.     public function setRedirectLeMedecin($redirectLeMedecin)
  1287.     {
  1288.         $this->redirectLeMedecin $redirectLeMedecin;
  1289.     }
  1290.     /**
  1291.      * @return mixed
  1292.      */
  1293.     public function getOrdonnances()
  1294.     {
  1295.         return $this->ordonnances;
  1296.     }
  1297.     /**
  1298.      * @param mixed $ordonnances
  1299.      */
  1300.     public function setOrdonnances($ordonnances)
  1301.     {
  1302.         $this->ordonnances $ordonnances;
  1303.     }
  1304.     /**
  1305.      * @return mixed
  1306.      */
  1307.     public function getFeuilles()
  1308.     {
  1309.         return $this->feuilles;
  1310.     }
  1311.     /**
  1312.      * @param mixed $feuilles
  1313.      */
  1314.     public function setFeuilles($feuilles)
  1315.     {
  1316.         $this->feuilles $feuilles;
  1317.     }
  1318.     /**
  1319.      * @return mixed
  1320.      */
  1321.     public function getArrets()
  1322.     {
  1323.         return $this->arrets;
  1324.     }
  1325.     /**
  1326.      * @param mixed $arrets
  1327.      */
  1328.     public function setArrets($arrets)
  1329.     {
  1330.         $this->arrets $arrets;
  1331.     }
  1332.     /**
  1333.      * @return mixed
  1334.      */
  1335.     public function getSmsReminder()
  1336.     {
  1337.         return $this->smsReminder;
  1338.     }
  1339.     /**
  1340.      * @param mixed $smsReminder
  1341.      */
  1342.     public function setSmsReminder($smsReminder)
  1343.     {
  1344.         $this->smsReminder $smsReminder;
  1345.     }
  1346.     /**
  1347.      * @return mixed
  1348.      */
  1349.     public function getSmsEndTeleconsultation()
  1350.     {
  1351.         return $this->smsEndTeleconsultation;
  1352.     }
  1353.     /**
  1354.      * @param mixed $smsEndTeleconsultation
  1355.      */
  1356.     public function setSmsEndTeleconsultation($smsEndTeleconsultation)
  1357.     {
  1358.         $this->smsEndTeleconsultation $smsEndTeleconsultation;
  1359.     }
  1360.     /**
  1361.      * @return mixed
  1362.      */
  1363.     public function getPatientAbs()
  1364.     {
  1365.         return $this->patientAbs;
  1366.     }
  1367.     /**
  1368.      * @param mixed $patientAbs
  1369.      */
  1370.     public function setPatientAbs($patientAbs)
  1371.     {
  1372.         $this->patientAbs $patientAbs;
  1373.     }
  1374.     /**
  1375.      * @return mixed
  1376.      */
  1377.     public function getEmailReminder()
  1378.     {
  1379.         return $this->emailReminder;
  1380.     }
  1381.     /**
  1382.      * @param mixed $emailReminder
  1383.      */
  1384.     public function setEmailReminder($emailReminder)
  1385.     {
  1386.         $this->emailReminder $emailReminder;
  1387.     }
  1388.     /**
  1389.      * @return bool
  1390.      */
  1391.     public function isSmsNotFound(): bool
  1392.     {
  1393.         return $this->smsNotFound;
  1394.     }
  1395.     /**
  1396.      * @param bool $smsNotFound
  1397.      */
  1398.     public function setSmsNotFound(bool $smsNotFound): void
  1399.     {
  1400.         $this->smsNotFound $smsNotFound;
  1401.     }
  1402.     /**
  1403.      * @return bool
  1404.      */
  1405.     public function isNotificationsSent(): bool
  1406.     {
  1407.         return $this->notificationsSent;
  1408.     }
  1409.     /**
  1410.      * @param bool $notificationsSent
  1411.      */
  1412.     public function setNotificationsSent(bool $notificationsSent): void
  1413.     {
  1414.         $this->notificationsSent $notificationsSent;
  1415.     }
  1416. }