src/Entity/Vacation.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\VacationRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. /**
  8.  * @ORM\Entity(repositoryClass=VacationRepository::class)
  9.  * @ApiResource(
  10.  *     collectionOperations={"get","post"},
  11.  *     itemOperations={"get","put","patch","delete"},
  12.  *     normalizationContext={"groups"={"vacation"}},
  13.  *     denormalizationContext={"groups"={"vacation"}},
  14.  *     attributes={"pagination_enabled"=false}
  15.  * )
  16.  */
  17. class Vacation
  18. {
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\GeneratedValue
  22.      * @ORM\Column(type="integer")
  23.      * @Groups("vacation")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\Column(type="string", length=255)
  28.      * @Groups("vacation")
  29.      */
  30.     private $lib;
  31.     /**
  32.      * @ORM\Column(type="date")
  33.      * @Groups("vacation")
  34.      */
  35.     private $dateOf;
  36.     /**
  37.      * @ORM\Column(type="date")
  38.      * @Groups("vacation")
  39.      */
  40.     private $dateTo;
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getLib(): ?string
  46.     {
  47.         return $this->lib;
  48.     }
  49.     public function setLib(string $lib): self
  50.     {
  51.         $this->lib $lib;
  52.         return $this;
  53.     }
  54.     public function getDateOf(): ?\DateTimeInterface
  55.     {
  56.         return $this->dateOf;
  57.     }
  58.     public function setDateOf(\DateTimeInterface $dateOf): self
  59.     {
  60.         $this->dateOf $dateOf;
  61.         return $this;
  62.     }
  63.     public function getDateTo(): ?\DateTimeInterface
  64.     {
  65.         return $this->dateTo;
  66.     }
  67.     public function setDateTo(\DateTimeInterface $dateTo): self
  68.     {
  69.         $this->dateTo $dateTo;
  70.         return $this;
  71.     }
  72. }