<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\VacationRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=VacationRepository::class)
* @ApiResource(
* collectionOperations={"get","post"},
* itemOperations={"get","put","patch","delete"},
* normalizationContext={"groups"={"vacation"}},
* denormalizationContext={"groups"={"vacation"}},
* attributes={"pagination_enabled"=false}
* )
*/
class Vacation
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups("vacation")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Groups("vacation")
*/
private $lib;
/**
* @ORM\Column(type="date")
* @Groups("vacation")
*/
private $dateOf;
/**
* @ORM\Column(type="date")
* @Groups("vacation")
*/
private $dateTo;
public function getId(): ?int
{
return $this->id;
}
public function getLib(): ?string
{
return $this->lib;
}
public function setLib(string $lib): self
{
$this->lib = $lib;
return $this;
}
public function getDateOf(): ?\DateTimeInterface
{
return $this->dateOf;
}
public function setDateOf(\DateTimeInterface $dateOf): self
{
$this->dateOf = $dateOf;
return $this;
}
public function getDateTo(): ?\DateTimeInterface
{
return $this->dateTo;
}
public function setDateTo(\DateTimeInterface $dateTo): self
{
$this->dateTo = $dateTo;
return $this;
}
}