src/Entity/SpecialiteDocteur.php line 34

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 Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  14. use ApiPlatform\Core\Annotation\ApiResource;
  15. use App\Repository\SpecialiteDocteurRepository;
  16. use Symfony\Component\Serializer\Annotation\Groups;
  17. /**
  18.  * SpecialiteDocteur
  19.  *
  20.  * @ORM\Table()
  21.  * @UniqueEntity("label")
  22.  * @ORM\Entity(repositoryClass=SpecialiteDocteurRepository::class)
  23.  * @ApiResource(attributes={
  24.  *     "pagination_client_items_per_page"=true,
  25.  *     "filters"={"specialite_docteur.order", "specialite_docteur.boolean"},
  26.  *     "normalization_context"={"groups"={"read"}},
  27.  *     "denormalization_context"={"groups"={"write"}}
  28.  * })
  29.  */
  30. class SpecialiteDocteur
  31. {
  32.     /**
  33.      * @var int
  34.      *
  35.      * @ORM\Column(name="id", type="integer")
  36.      * @ORM\Id
  37.      * @ORM\GeneratedValue(strategy="AUTO")
  38.      *
  39.      * @Groups({"read"})
  40.      */
  41.     private $id;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(name="label", type="string", length=100)
  46.      *
  47.      * @Assert\NotBlank()
  48.      * @Groups({"read"})
  49.      */
  50.     private $label;
  51.     /**
  52.      * @var bool
  53.      *
  54.      * @ORM\Column(name="generaliste", type="boolean")
  55.      * @Groups({"read"})
  56.      */
  57.     private $generaliste;
  58.     /**
  59.      * @var bool
  60.      *
  61.      * @ORM\Column(name="urgentiste", type="boolean")
  62.      * @Groups({"read"})
  63.      */
  64.     private $urgentiste;
  65.     /**
  66.      * @var bool
  67.      *
  68.      * @ORM\Column(name="visio", type="boolean")
  69.      * @Groups({"read"})
  70.      */
  71.     private $visio;
  72.     /**
  73.      * @var bool
  74.      *
  75.      * @ORM\Column(name="actif", type="boolean")
  76.      * @Groups({"read"})
  77.      */
  78.     private $actif;
  79.     /**
  80.      * @var string|null
  81.      *
  82.      * @ORM\Column(name="code", type="string", length=5, nullable=true)
  83.      *
  84.      * @Assert\IsNull(groups={"optional"})
  85.      * @Assert\Length(max=5)
  86.      * @Groups({"read"})
  87.      */
  88.     private $code;
  89.     /**
  90.      * Constructor of SpecialiteDocteur Entity
  91.      */
  92.     public function __construct()
  93.     {
  94.         $this->generaliste false;
  95.         $this->urgentiste false;
  96.         $this->visio false;
  97.         $this->actif true;
  98.     }
  99.     public function __toString()
  100.     {
  101.         return ($this->getLabel()) ? $this->getLabel() : '';
  102.     }
  103.     /**
  104.      * Get id
  105.      *
  106.      * @return integer
  107.      */
  108.     public function getId()
  109.     {
  110.         return $this->id;
  111.     }
  112.     /**
  113.      * Get label
  114.      *
  115.      * @return string
  116.      */
  117.     public function getLabel()
  118.     {
  119.         return $this->label;
  120.     }
  121.     /**
  122.      * Set label
  123.      *
  124.      * @param string $label
  125.      *
  126.      * @return SpecialiteDocteur
  127.      */
  128.     public function setLabel($label)
  129.     {
  130.         $this->label $label;
  131.         return $this;
  132.     }
  133.     /**
  134.      * Get actif
  135.      *
  136.      * @return boolean
  137.      */
  138.     public function getActif()
  139.     {
  140.         return $this->actif;
  141.     }
  142.     /**
  143.      * Set actif
  144.      *
  145.      * @param bool $actif
  146.      *
  147.      * @return SpecialiteDocteur
  148.      */
  149.     public function setActif($actif)
  150.     {
  151.         $this->actif $actif;
  152.         return $this;
  153.     }
  154.     /**
  155.      * Get generaliste
  156.      *
  157.      * @return boolean
  158.      */
  159.     public function getGeneraliste()
  160.     {
  161.         return $this->generaliste;
  162.     }
  163.     /**
  164.      * Set generaliste
  165.      *
  166.      * @param bool $generaliste
  167.      *
  168.      * @return SpecialiteDocteur
  169.      */
  170.     public function setGeneraliste($generaliste)
  171.     {
  172.         $this->generaliste $generaliste;
  173.         return $this;
  174.     }
  175.     /**
  176.      * Get urgentiste
  177.      *
  178.      * @return boolean
  179.      */
  180.     public function getUrgentiste()
  181.     {
  182.         return $this->urgentiste;
  183.     }
  184.     /**
  185.      * Set urgentiste
  186.      *
  187.      * @param bool $urgentiste
  188.      *
  189.      * @return SpecialiteDocteur
  190.      */
  191.     public function setUrgentiste($urgentiste)
  192.     {
  193.         $this->urgentiste $urgentiste;
  194.         return $this;
  195.     }
  196.     /**
  197.      * Get visio
  198.      *
  199.      * @return boolean
  200.      */
  201.     public function getVisio()
  202.     {
  203.         return $this->visio;
  204.     }
  205.     /**
  206.      * Set visio
  207.      *
  208.      * @param bool $visio
  209.      *
  210.      * @return SpecialiteDocteur
  211.      */
  212.     public function setVisio($visio)
  213.     {
  214.         $this->visio $visio;
  215.         return $this;
  216.     }
  217.     public function getCode(): ?string
  218.     {
  219.         return $this->code;
  220.     }
  221.     public function setCode(string $code): self
  222.     {
  223.         $this->code $code;
  224.         return $this;
  225.     }
  226. }