src/Entity/AnalyticPhone.php line 32

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use App\Entity\Docteur;
  6. use App\Entity\Laboratoire;
  7. use App\Entity\Client;
  8. use App\Entity\SpecialiteDocteur;
  9. use App\Entity\SpecialiteLaboratoire;
  10. use ApiPlatform\Core\Annotation\ApiResource;
  11. use Symfony\Component\Serializer\Annotation\Groups;
  12. use Doctrine\Common\Collections\ArrayCollection;
  13. /**
  14.  * AnalyticPhone
  15.  *
  16.  * @ORM\Table()
  17.  * @ORM\Entity(repositoryClass="App\Entity\AnalyticPhoneRepository")
  18.  * @ApiResource(
  19.  *     attributes={
  20.  *       "force_eager"=false,
  21.  *       "normalization_context"={"groups"={"read", "user", "media"}},
  22.  *       "denormalization_context"={"groups"={"read", "user", "media"}}
  23.  *     }
  24.  * )
  25.  */
  26. class AnalyticPhone
  27. {
  28.     /**
  29.      * @var int
  30.      *
  31.      * @ORM\Column(name="id", type="integer")
  32.      * @ORM\Id
  33.      * @ORM\GeneratedValue(strategy="AUTO")
  34.      *
  35.      * @Groups({"read"})
  36.      */
  37.     private $id;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="type", type="string", length=30)
  42.      *
  43.      * @Assert\NotBlank()
  44.      * @Groups({"read"})
  45.      */
  46.     private $type;
  47.     /**
  48.      * @var string
  49.      *
  50.      * @ORM\Column(name="typeUser", type="string", length=30)
  51.      *
  52.      * @Assert\NotBlank()
  53.      * @Groups({"read"})
  54.      */
  55.     private $typeUser;
  56.     /**
  57.      * @var datetime
  58.      *
  59.      * @ORM\Column(name="horodateCreation", type="datetime")
  60.      *
  61.      * @Assert\NotBlank()
  62.      * @Groups({"read"})
  63.      */
  64.     private $horodateCreation;
  65.     /**
  66.      * @var ArrayCollection
  67.      *
  68.      * @ORM\ManyToOne(
  69.      *   targetEntity="App\Entity\Docteur",
  70.      *   cascade={"persist"}
  71.      * )
  72.      * @Groups({"read"})
  73.      */
  74.     private $docteur;
  75.     /**
  76.      * @var ArrayCollection
  77.      *
  78.      * @ORM\ManyToOne(
  79.      *   targetEntity=Laboratoire::class,
  80.      *   cascade={"persist"}
  81.      * )
  82.      * @Groups({"read"})
  83.      */
  84.     private $laboratoire;
  85.     /**
  86.      * @var ArrayCollection
  87.      *
  88.      * @ORM\ManyToOne(
  89.      *   targetEntity=Client::class,
  90.      *   cascade={"persist"}
  91.      * )
  92.      * @Groups({"read"})
  93.      */
  94.     private $client;
  95.     /**
  96.      * @var stdClass
  97.      *
  98.      * @ORM\ManyToOne(
  99.      *   targetEntity="App\Entity\SpecialiteDocteur",
  100.      *   cascade={"persist"}
  101.      * )
  102.      * @Groups({"read"})
  103.      */
  104.     private $specialiteDocteur;
  105.     /**
  106.      * @var stdClass
  107.      *
  108.      * @ORM\ManyToOne(
  109.      *   targetEntity="App\Entity\SpecialiteLaboratoire",
  110.      *   cascade={"persist"}
  111.      * )
  112.      * @Groups({"read"})
  113.      */
  114.     private $specialiteLaboratoire;
  115.     /**
  116.      * Constructor of AnalyticPhone Entity
  117.      */
  118.     public function __construct()
  119.     {
  120.         $this->horodateCreation = new \DateTime;
  121.     }
  122.     public function __toString()
  123.     {
  124.         return ($this->getClient()) ? $this->getClient(). ' - '$this->getType(). ' - '$this->getTypeUser() : $this->getId() . ' - '$this->getType(). ' - '$this->getType();
  125.     }
  126.     /**
  127.      * Get id
  128.      *
  129.      * @return integer
  130.      */
  131.     public function getId()
  132.     {
  133.         return $this->id;
  134.     }
  135.     /**
  136.      * Get type
  137.      *
  138.      * @return string
  139.      */
  140.     public function getType()
  141.     {
  142.         return $this->type;
  143.     }
  144.     /**
  145.      * Set type
  146.      *
  147.      * @param string $type
  148.      *
  149.      * @return AnalyticPhone
  150.      */
  151.     public function setType($type)
  152.     {
  153.         $this->type $type;
  154.         return $this;
  155.     }
  156.     /**
  157.      * Get typeUser
  158.      *
  159.      * @return string
  160.      */
  161.     public function getTypeUser()
  162.     {
  163.         return $this->typeUser;
  164.     }
  165.     /**
  166.      * Set typeUser
  167.      *
  168.      * @param string $typeUser
  169.      *
  170.      * @return AnalyticPhone
  171.      */
  172.     public function setTypeUser($typeUser)
  173.     {
  174.         $this->typeUser $typeUser;
  175.         return $this;
  176.     }
  177.     /**
  178.      * Get horodateCreation
  179.      *
  180.      * @return datetime
  181.      */
  182.     public function getHorodateCreation()
  183.     {
  184.         return $this->horodateCreation;
  185.     }
  186.     /**
  187.      * Set horodateCreation
  188.      *
  189.      * @param datetime $horodateCreation
  190.      *
  191.      * @return AnalyticPhone
  192.      */
  193.     public function setHorodateCreation($horodateCreation)
  194.     {
  195.         $this->horodateCreation $horodateCreation;
  196.         return $this;
  197.     }
  198.     /**
  199.      * Get getDateInfoString
  200.      *
  201.      * @return \DateTime
  202.      * @Groups({"read"})
  203.      */
  204.     public function getDateInfoString()
  205.     {
  206.         return $this->horodateCreation->format('Y-m-d');
  207.     }
  208.     /**
  209.      * Get getDateTimeInfoString
  210.      *
  211.      * @return \DateTime
  212.      * @Groups({"read"})
  213.      */
  214.     public function getDateTimeInfoString()
  215.     {
  216.         return $this->horodateCreation->format('c');
  217.     }
  218.     /**
  219.      * Get docteur
  220.      *
  221.      * @return stdClass
  222.      */
  223.     public function getDocteur()
  224.     {
  225.         return $this->docteur;
  226.     }
  227.     /**
  228.      * Set docteur
  229.      *
  230.      * @param Docteur $docteur
  231.      *
  232.      * @return AnalyticPhone
  233.      */
  234.     public function setDocteur(Docteur $docteur)
  235.     {
  236.         $this->docteur $docteur;
  237.         return $this;
  238.     }
  239.     /**
  240.      * Get laboratoire
  241.      *
  242.      * @return stdClass
  243.      */
  244.     public function getLaboratoire()
  245.     {
  246.         return $this->laboratoire;
  247.     }
  248.     /**
  249.      * Set laboratoire
  250.      *
  251.      * @param Laboratoire $laboratoire
  252.      *
  253.      * @return AnalyticPhone
  254.      */
  255.     public function setLaboratoire(Laboratoire $laboratoire)
  256.     {
  257.         $this->laboratoire $laboratoire;
  258.         return $this;
  259.     }
  260.     /**
  261.      * Get client
  262.      *
  263.      * @return stdClass
  264.      */
  265.     public function getClient()
  266.     {
  267.         return $this->client;
  268.     }
  269.     /**
  270.      * Set client
  271.      *
  272.      * @param Client $client
  273.      *
  274.      * @return AnalyticPhone
  275.      */
  276.     public function setClient(Client $client)
  277.     {
  278.         $this->client $client;
  279.         return $this;
  280.     }
  281.     /**
  282.      * Get specialiteDocteur
  283.      *
  284.      * @return stdClass
  285.      */
  286.     public function getSpecialiteDocteur()
  287.     {
  288.         return $this->specialiteDocteur;
  289.     }
  290.     /**
  291.      * Set specialiteDocteur
  292.      *
  293.      * @param SpecialiteDocteur $specialiteDocteur
  294.      *
  295.      * @return AnalyticPhone
  296.      */
  297.     public function setSpecialiteDocteur(SpecialiteDocteur $specialiteDocteur)
  298.     {
  299.         $this->specialiteDocteur $specialiteDocteur;
  300.         return $this;
  301.     }
  302.     /**
  303.      * Get specialiteLaboratoire
  304.      *
  305.      * @return stdClass
  306.      */
  307.     public function getSpecialiteLaboratoire()
  308.     {
  309.         return $this->specialiteLaboratoire;
  310.     }
  311.     /**
  312.      * Set specialiteLaboratoire
  313.      *
  314.      * @param SpecialiteLaboratoire $specialiteLaboratoire
  315.      *
  316.      * @return AnalyticPhone
  317.      */
  318.     public function setSpecialiteLaboratoire(SpecialiteLaboratoire $specialiteLaboratoire)
  319.     {
  320.         $this->specialiteLaboratoire $specialiteLaboratoire;
  321.         return $this;
  322.     }
  323. }