src/Entity/SpecialiteLaboratoire.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 Symfony\Component\Serializer\Annotation\Groups;
  16. /**
  17.  * SpecialiteLaboratoire
  18.  *
  19.  * @ORM\Table()
  20.  * @UniqueEntity("label")
  21.  * @ORM\Entity(repositoryClass="App\Repository\SpecialiteLaboratoireRepository")
  22.  * @ApiResource(attributes={
  23.  *     "pagination_client_items_per_page"=true,
  24.  *     "filters"={"specialite_laboratoire.order", "specialite_laboratoire.boolean"},
  25.  *     "normalization_context"={"groups"={"read"}},
  26.  *     "denormalization_context"={"groups"={"write"}}
  27.  * })
  28.  */
  29. class SpecialiteLaboratoire
  30. {
  31.     /**
  32.      * @var int
  33.      *
  34.      * @ORM\Column(name="id", type="integer")
  35.      * @ORM\Id
  36.      * @ORM\GeneratedValue(strategy="AUTO")
  37.      *
  38.      * @Groups({"read"})
  39.      */
  40.     private $id;
  41.     /**
  42.      * @var string
  43.      *
  44.      * @ORM\Column(name="label", type="string", length=100)
  45.      *
  46.      * @Assert\NotBlank()
  47.      * @Groups({"read"})
  48.      */
  49.     private $label;
  50.     /**
  51.      * @var bool
  52.      *
  53.      * @ORM\Column(name="actif", type="boolean")
  54.      * @Groups({"read"})
  55.      */
  56.     private $actif;
  57.     /**
  58.      * Constructor of SpecialiteLaboratoire Entity
  59.      */
  60.     public function __construct()
  61.     {
  62.         $this->actif true;
  63.     }
  64.     public function __toString()
  65.     {
  66.         return ($this->getLabel()) ? $this->getLabel() : '';
  67.     }
  68.     /**
  69.      * Get id
  70.      *
  71.      * @return integer
  72.      */
  73.     public function getId()
  74.     {
  75.         return $this->id;
  76.     }
  77.     /**
  78.      * Get label
  79.      *
  80.      * @return string
  81.      */
  82.     public function getLabel()
  83.     {
  84.         return $this->label;
  85.     }
  86.     /**
  87.      * Set label
  88.      *
  89.      * @param string $label
  90.      *
  91.      * @return SpecialiteLaboratoire
  92.      */
  93.     public function setLabel($label)
  94.     {
  95.         $this->label $label;
  96.         return $this;
  97.     }
  98.     /**
  99.      * Get actif
  100.      *
  101.      * @return boolean
  102.      */
  103.     public function getActif()
  104.     {
  105.         return $this->actif;
  106.     }
  107.     /**
  108.      * Set actif
  109.      *
  110.      * @param bool $actif
  111.      *
  112.      * @return SpecialiteLaboratoire
  113.      */
  114.     public function setActif($actif)
  115.     {
  116.         $this->actif $actif;
  117.         return $this;
  118.     }
  119. }