src/Entity/Meeting.php line 30

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the kProjet project.
  4.  *
  5.  * (c) Kodiom <info@kodiom.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace App\Entity;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. use App\Entity\Docteur;
  14. use App\Entity\Client;
  15. use ApiPlatform\Core\Annotation\ApiResource;
  16. use Symfony\Component\Serializer\Annotation\Groups;
  17. /**
  18.  * Meeting
  19.  * ??
  20.  * @ORM\Table()
  21.  * @ORM\Entity(repositoryClass="App\Entity\MeetingRepository")
  22.  * @ApiResource()
  23.  */
  24. class Meeting
  25. {
  26.     /**
  27.      * @var int
  28.      *
  29.      * @ORM\Column(name="id", type="integer")
  30.      * @ORM\Id
  31.      * @ORM\GeneratedValue(strategy="AUTO")
  32.      *
  33.      * @Groups({"read"})
  34.      */
  35.     private $id;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="numeroReference", type="string", length=100)
  40.      *
  41.      * @Assert\NotBlank()
  42.      * @Groups({"read"})
  43.      */
  44.     private $numeroReference;
  45.     /**
  46.      * @var string
  47.      *
  48.      * @ORM\Column(name="chargeToken", type="string", length=50, nullable=true)
  49.      */
  50.     private $chargeToken;
  51.     /**
  52.      * @var text
  53.      *
  54.      * @ORM\Column(name="symptomes", type="string", length=100, nullable=true)
  55.      * @Groups({"read"})
  56.      */
  57.     private $symptomes;
  58.     /**
  59.      * @var stdClass
  60.      *
  61.      * @ORM\ManyToOne(targetEntity="App\Entity\SpecialiteDocteur", cascade={"persist"})
  62.      * @ORM\JoinColumn(onDelete="SET NULL")
  63.      * @Groups({"read"})
  64.      */
  65.     private $specialite;
  66.     /**
  67.      * @var string
  68.      *
  69.      * @ORM\Column(name="etat", type="string", length=50)
  70.      *
  71.      * @Assert\NotBlank()
  72.      * @Groups({"read"})
  73.      */
  74.     private $etat;
  75.     /**
  76.      * @var string
  77.      *
  78.      * @ORM\Column(name="motifEtatAnnule", type="string", length=250, nullable=true)
  79.      * @Groups({"read"})
  80.      */
  81.     private $motifEtatAnnule;
  82.     /**
  83.      * @var string
  84.      *
  85.      * @ORM\Column(name="adressePays", type="string", length=6)
  86.      *
  87.      * @Assert\NotBlank()
  88.      * @Groups({"read"})
  89.      */
  90.     private $adressePays;
  91.     /**
  92.      * @var string
  93.      *
  94.      * @ORM\Column(name="modeIntervention", type="string", length=20)
  95.      *
  96.      * @Assert\NotBlank()
  97.      * @Groups({"read"})
  98.      */
  99.     private $modeIntervention;
  100.     /**
  101.      * @var string
  102.      *
  103.      * @ORM\Column(name="typeIntervention", type="string", length=20)
  104.      *
  105.      * @Assert\NotBlank()
  106.      * @Groups({"read"})
  107.      */
  108.     private $typeIntervention;
  109.     /**
  110.      * @var datetime
  111.      *
  112.      * @ORM\Column(name="horodateCreation", type="datetime")
  113.      *
  114.      * @Assert\NotBlank()
  115.      * @Groups({"read"})
  116.      */
  117.     private $horodateCreation;
  118.     /**
  119.      * @var stdClass
  120.      *
  121.      * @ORM\ManyToOne(targetEntity="App\Entity\Card")
  122.      * @ORM\JoinColumn(onDelete="SET NULL")
  123.      * @Groups({"read"})
  124.      */
  125.     private $carteBancaire;
  126.     /**
  127.      * @var stdClass
  128.      *
  129.      * @ORM\ManyToOne(
  130.      *   targetEntity="App\Entity\Docteur",
  131.      *   cascade={"persist"}
  132.      * )
  133.      * @ORM\JoinColumn(onDelete="SET NULL")
  134.      * @Groups({"read"})
  135.      */
  136.     private $docteur;
  137.     /**
  138.      * @var stdClass
  139.      *
  140.      * @ORM\ManyToOne(
  141.      *   targetEntity=Client::class,
  142.      *   cascade={"persist"}
  143.      * )
  144.      * @ORM\JoinColumn(onDelete="SET NULL")
  145.      * @Groups({"read"})
  146.      */
  147.     private $client;
  148.     /**
  149.      * Constructor of Meeting Entity
  150.      */
  151.     public function __construct()
  152.     {
  153.         $this->etat 'emis';
  154.         $this->adressePays 'France';
  155.         $this->numeroReference uniqid();
  156.         $this->modeIntervention 'physique';
  157.         $this->typeIntervention 'mobile';
  158.         $this->horodateCreation = new \DateTime;
  159.     }
  160.     public function __toString()
  161.     {
  162.         $numeroReference = ($this->getNumeroReference()) ? $this->getNumeroReference() : '';
  163.         return ($this->getClient() && $this->getDocteur()) ? $this->getClient().' - '.$this->getDocteur(). '-'$numeroReference $this->getId() . ' - '$this->getEtat(). '-'$numeroReference;
  164.     }
  165.     /**
  166.      * Get id
  167.      *
  168.      * @return integer
  169.      */
  170.     public function getId()
  171.     {
  172.         return $this->id;
  173.     }
  174.     /**
  175.      * Get etat
  176.      *
  177.      * @return string
  178.      */
  179.     public function getEtat()
  180.     {
  181.         return $this->etat;
  182.     }
  183.     /**
  184.      * Set etat
  185.      *
  186.      * @param string $etat
  187.      *
  188.      * @return Meeting
  189.      */
  190.     public function setEtat($etat)
  191.     {
  192.         $this->etat $etat;
  193.         return $this;
  194.     }
  195.     /**
  196.      * Get motifEtatAnnule
  197.      *
  198.      * @return string
  199.      */
  200.     public function getMotifEtatAnnule()
  201.     {
  202.         return $this->motifEtatAnnule;
  203.     }
  204.     /**
  205.      * Set motifEtatAnnule
  206.      *
  207.      * @param string $motifEtatAnnule
  208.      *
  209.      * @return Meeting
  210.      */
  211.     public function setMotifEtatAnnule($motifEtatAnnule)
  212.     {
  213.         $this->motifEtatAnnule $motifEtatAnnule;
  214.         return $this;
  215.     }
  216.     /**
  217.      * Get adressePays
  218.      *
  219.      * @return string
  220.      */
  221.     public function getAdressePays()
  222.     {
  223.         return $this->adressePays;
  224.     }
  225.     /**
  226.      * Set adressePays
  227.      *
  228.      * @param string $adressePays
  229.      *
  230.      * @return Meeting
  231.      */
  232.     public function setAdressePays($adressePays)
  233.     {
  234.         $this->adressePays $adressePays;
  235.         return $this;
  236.     }
  237.     /**
  238.      * Get modeIntervention
  239.      *
  240.      * @return string
  241.      */
  242.     public function getModeIntervention()
  243.     {
  244.         return $this->modeIntervention;
  245.     }
  246.     /**
  247.      * Set modeIntervention
  248.      *
  249.      * @param string $modeIntervention
  250.      *
  251.      * @return Meeting
  252.      */
  253.     public function setModeIntervention($modeIntervention)
  254.     {
  255.         $this->modeIntervention $modeIntervention;
  256.         return $this;
  257.     }
  258.     /**
  259.      * Get numeroReference
  260.      *
  261.      * @return string
  262.      */
  263.     public function getNumeroReference()
  264.     {
  265.         return $this->numeroReference;
  266.     }
  267.     /**
  268.      * Set numeroReference
  269.      *
  270.      * @param string $numeroReference
  271.      *
  272.      * @return Meeting
  273.      */
  274.     public function setNumeroReference($numeroReference)
  275.     {
  276.         $this->numeroReference $numeroReference;
  277.         return $this;
  278.     }
  279.     /**
  280.      * Get chargeToken
  281.      *
  282.      * @return string
  283.      */
  284.     public function getChargeToken()
  285.     {
  286.         return $this->chargeToken;
  287.     }
  288.     /**
  289.      * Set chargeToken
  290.      *
  291.      * @param string $chargeToken
  292.      *
  293.      * @return Meeting
  294.      */
  295.     public function setChargeToken($chargeToken)
  296.     {
  297.         $this->chargeToken $chargeToken;
  298.         return $this;
  299.     }
  300.     /**
  301.      * Get typeIntervention
  302.      *
  303.      * @return string
  304.      */
  305.     public function getTypeIntervention()
  306.     {
  307.         return $this->typeIntervention;
  308.     }
  309.     /**
  310.      * Set typeIntervention
  311.      *
  312.      * @param string $typeIntervention
  313.      *
  314.      * @return Meeting
  315.      */
  316.     public function setTypeIntervention($typeIntervention)
  317.     {
  318.         $this->typeIntervention $typeIntervention;
  319.         return $this;
  320.     }
  321.     /**
  322.      * Get symptomes
  323.      *
  324.      * @return text
  325.      */
  326.     public function getSymptomes()
  327.     {
  328.         return $this->symptomes;
  329.     }
  330.     /**
  331.      * Set symptomes
  332.      *
  333.      * @param text $symptomes
  334.      *
  335.      * @return Meeting
  336.      */
  337.     public function setSymptomes($symptomes)
  338.     {
  339.         $this->symptomes $symptomes;
  340.         return $this;
  341.     }
  342.     /**
  343.      * Get specialite
  344.      *
  345.      * @return stdClass
  346.      */
  347.     public function getSpecialite()
  348.     {
  349.         return $this->specialite;
  350.     }
  351.     /**
  352.      * Set specialite
  353.      *
  354.      * @param Client $specialite
  355.      *
  356.      * @return Meeting
  357.      */
  358.     public function setSpecialite($specialite)
  359.     {
  360.         $this->specialite $specialite;
  361.         return $this;
  362.     }
  363.     /**
  364.      * Get horodateCreation
  365.      *
  366.      * @return datetime
  367.      */
  368.     public function getHorodateCreation()
  369.     {
  370.         return $this->horodateCreation;
  371.     }
  372.     /**
  373.      * Set horodateCreation
  374.      *
  375.      * @param datetime $horodateCreation
  376.      *
  377.      * @return Meeting
  378.      */
  379.     public function setHorodateCreation($horodateCreation)
  380.     {
  381.         $this->horodateCreation $horodateCreation;
  382.         return $this;
  383.     }
  384.     /**
  385.      * Get getDateInfoString
  386.      *
  387.      * @return \DateTime
  388.      * @Groups({"read"})
  389.      */
  390.     public function getDateInfoString()
  391.     {
  392.         return $this->horodateCreation->format('Y-m-d');
  393.     }
  394.     /**
  395.      * Get getDateTimeInfoString
  396.      *
  397.      * @return \DateTime
  398.      * @Groups({"read"})
  399.      */
  400.     public function getDateTimeInfoString()
  401.     {
  402.         return $this->horodateCreation->format('c');
  403.     }
  404.     /**
  405.      * Get carteBancaire
  406.      *
  407.      * @return stdClass
  408.      */
  409.     public function getCarteBancaire()
  410.     {
  411.         return $this->carteBancaire;
  412.     }
  413.     /**
  414.      * Set carteBancaire
  415.      *
  416.      * @param CarteBancaire $carteBancaire
  417.      *
  418.      * @return Intervention
  419.      */
  420.     public function setCarteBancaire($carteBancaire)
  421.     {
  422.         $this->carteBancaire $carteBancaire;
  423.         return $this;
  424.     }
  425.     /**
  426.      * Get docteur
  427.      *
  428.      * @return stdClass
  429.      */
  430.     public function getDocteur()
  431.     {
  432.         return $this->docteur;
  433.     }
  434.     /**
  435.      * Set docteur
  436.      *
  437.      * @param Docteur $docteur
  438.      *
  439.      * @return Meeting
  440.      */
  441.     public function setDocteur(Docteur $docteur)
  442.     {
  443.         $this->docteur $docteur;
  444.         return $this;
  445.     }
  446.     /**
  447.      * Get client
  448.      *
  449.      * @return stdClass
  450.      */
  451.     public function getClient()
  452.     {
  453.         return $this->client;
  454.     }
  455.     /**
  456.      * Set client
  457.      *
  458.      * @param Client $client
  459.      *
  460.      * @return Meeting
  461.      */
  462.     public function setClient(Client $client)
  463.     {
  464.         $this->client $client;
  465.         return $this;
  466.     }
  467. }