<?php
/*
* This file is part of the kProjet project.
*
* (c) Kodiom <info@kodiom.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use App\Entity\Docteur;
use App\Entity\Client;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* Meeting
* ??
* @ORM\Table()
* @ORM\Entity(repositoryClass="App\Entity\MeetingRepository")
* @ApiResource()
*/
class Meeting
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"read"})
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="numeroReference", type="string", length=100)
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $numeroReference;
/**
* @var string
*
* @ORM\Column(name="chargeToken", type="string", length=50, nullable=true)
*/
private $chargeToken;
/**
* @var text
*
* @ORM\Column(name="symptomes", type="string", length=100, nullable=true)
* @Groups({"read"})
*/
private $symptomes;
/**
* @var stdClass
*
* @ORM\ManyToOne(targetEntity="App\Entity\SpecialiteDocteur", cascade={"persist"})
* @ORM\JoinColumn(onDelete="SET NULL")
* @Groups({"read"})
*/
private $specialite;
/**
* @var string
*
* @ORM\Column(name="etat", type="string", length=50)
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $etat;
/**
* @var string
*
* @ORM\Column(name="motifEtatAnnule", type="string", length=250, nullable=true)
* @Groups({"read"})
*/
private $motifEtatAnnule;
/**
* @var string
*
* @ORM\Column(name="adressePays", type="string", length=6)
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $adressePays;
/**
* @var string
*
* @ORM\Column(name="modeIntervention", type="string", length=20)
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $modeIntervention;
/**
* @var string
*
* @ORM\Column(name="typeIntervention", type="string", length=20)
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $typeIntervention;
/**
* @var datetime
*
* @ORM\Column(name="horodateCreation", type="datetime")
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $horodateCreation;
/**
* @var stdClass
*
* @ORM\ManyToOne(targetEntity="App\Entity\Card")
* @ORM\JoinColumn(onDelete="SET NULL")
* @Groups({"read"})
*/
private $carteBancaire;
/**
* @var stdClass
*
* @ORM\ManyToOne(
* targetEntity="App\Entity\Docteur",
* cascade={"persist"}
* )
* @ORM\JoinColumn(onDelete="SET NULL")
* @Groups({"read"})
*/
private $docteur;
/**
* @var stdClass
*
* @ORM\ManyToOne(
* targetEntity=Client::class,
* cascade={"persist"}
* )
* @ORM\JoinColumn(onDelete="SET NULL")
* @Groups({"read"})
*/
private $client;
/**
* Constructor of Meeting Entity
*/
public function __construct()
{
$this->etat = 'emis';
$this->adressePays = 'France';
$this->numeroReference = uniqid();
$this->modeIntervention = 'physique';
$this->typeIntervention = 'mobile';
$this->horodateCreation = new \DateTime;
}
public function __toString()
{
$numeroReference = ($this->getNumeroReference()) ? $this->getNumeroReference() : '';
return ($this->getClient() && $this->getDocteur()) ? $this->getClient().' - '.$this->getDocteur(). '-'. $numeroReference : $this->getId() . ' - '. $this->getEtat(). '-'. $numeroReference;
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Get etat
*
* @return string
*/
public function getEtat()
{
return $this->etat;
}
/**
* Set etat
*
* @param string $etat
*
* @return Meeting
*/
public function setEtat($etat)
{
$this->etat = $etat;
return $this;
}
/**
* Get motifEtatAnnule
*
* @return string
*/
public function getMotifEtatAnnule()
{
return $this->motifEtatAnnule;
}
/**
* Set motifEtatAnnule
*
* @param string $motifEtatAnnule
*
* @return Meeting
*/
public function setMotifEtatAnnule($motifEtatAnnule)
{
$this->motifEtatAnnule = $motifEtatAnnule;
return $this;
}
/**
* Get adressePays
*
* @return string
*/
public function getAdressePays()
{
return $this->adressePays;
}
/**
* Set adressePays
*
* @param string $adressePays
*
* @return Meeting
*/
public function setAdressePays($adressePays)
{
$this->adressePays = $adressePays;
return $this;
}
/**
* Get modeIntervention
*
* @return string
*/
public function getModeIntervention()
{
return $this->modeIntervention;
}
/**
* Set modeIntervention
*
* @param string $modeIntervention
*
* @return Meeting
*/
public function setModeIntervention($modeIntervention)
{
$this->modeIntervention = $modeIntervention;
return $this;
}
/**
* Get numeroReference
*
* @return string
*/
public function getNumeroReference()
{
return $this->numeroReference;
}
/**
* Set numeroReference
*
* @param string $numeroReference
*
* @return Meeting
*/
public function setNumeroReference($numeroReference)
{
$this->numeroReference = $numeroReference;
return $this;
}
/**
* Get chargeToken
*
* @return string
*/
public function getChargeToken()
{
return $this->chargeToken;
}
/**
* Set chargeToken
*
* @param string $chargeToken
*
* @return Meeting
*/
public function setChargeToken($chargeToken)
{
$this->chargeToken = $chargeToken;
return $this;
}
/**
* Get typeIntervention
*
* @return string
*/
public function getTypeIntervention()
{
return $this->typeIntervention;
}
/**
* Set typeIntervention
*
* @param string $typeIntervention
*
* @return Meeting
*/
public function setTypeIntervention($typeIntervention)
{
$this->typeIntervention = $typeIntervention;
return $this;
}
/**
* Get symptomes
*
* @return text
*/
public function getSymptomes()
{
return $this->symptomes;
}
/**
* Set symptomes
*
* @param text $symptomes
*
* @return Meeting
*/
public function setSymptomes($symptomes)
{
$this->symptomes = $symptomes;
return $this;
}
/**
* Get specialite
*
* @return stdClass
*/
public function getSpecialite()
{
return $this->specialite;
}
/**
* Set specialite
*
* @param Client $specialite
*
* @return Meeting
*/
public function setSpecialite($specialite)
{
$this->specialite = $specialite;
return $this;
}
/**
* Get horodateCreation
*
* @return datetime
*/
public function getHorodateCreation()
{
return $this->horodateCreation;
}
/**
* Set horodateCreation
*
* @param datetime $horodateCreation
*
* @return Meeting
*/
public function setHorodateCreation($horodateCreation)
{
$this->horodateCreation = $horodateCreation;
return $this;
}
/**
* Get getDateInfoString
*
* @return \DateTime
* @Groups({"read"})
*/
public function getDateInfoString()
{
return $this->horodateCreation->format('Y-m-d');
}
/**
* Get getDateTimeInfoString
*
* @return \DateTime
* @Groups({"read"})
*/
public function getDateTimeInfoString()
{
return $this->horodateCreation->format('c');
}
/**
* Get carteBancaire
*
* @return stdClass
*/
public function getCarteBancaire()
{
return $this->carteBancaire;
}
/**
* Set carteBancaire
*
* @param CarteBancaire $carteBancaire
*
* @return Intervention
*/
public function setCarteBancaire($carteBancaire)
{
$this->carteBancaire = $carteBancaire;
return $this;
}
/**
* Get docteur
*
* @return stdClass
*/
public function getDocteur()
{
return $this->docteur;
}
/**
* Set docteur
*
* @param Docteur $docteur
*
* @return Meeting
*/
public function setDocteur(Docteur $docteur)
{
$this->docteur = $docteur;
return $this;
}
/**
* Get client
*
* @return stdClass
*/
public function getClient()
{
return $this->client;
}
/**
* Set client
*
* @param Client $client
*
* @return Meeting
*/
public function setClient(Client $client)
{
$this->client = $client;
return $this;
}
}