Files
SIRH/src/Entity/AbsenceType.php
tristan 76f1363457
All checks were successful
Auto Tag Develop / tag (push) Successful in 6s
[#321] Gestion des rôles dans l'application (#2)
| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|        #321          |        Gestion des rôles dans l'application         |

## Description de la PR
[#321] Gestion des rôles dans l'application

## Modification du .env

## Check list

- [x] Pas de régression
- [ ] TU/TI/TF rédigée
- [x] TU/TI/TF OK
- [ ] CHANGELOG modifié

Reviewed-on: #2
Co-authored-by: tristan <tristan@yuno.malio.fr>
Co-committed-by: tristan <tristan@yuno.malio.fr>
2026-02-16 07:19:05 +00:00

79 lines
1.6 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Attribute\Groups;
#[ApiResource(
normalizationContext: ['groups' => ['absence_type:read']],
paginationEnabled: false,
security: "is_granted('ROLE_ADMIN')"
)]
#[ORM\Entity]
#[ORM\Table(name: 'absence_types')]
class AbsenceType
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
#[Groups(['absence:read', 'absence_type:read'])]
private ?int $id = null;
#[ORM\Column(type: 'string', length: 10)]
#[Groups(['absence:read', 'absence_type:read'])]
private string $code = '';
#[ORM\Column(type: 'string', length: 100)]
#[Groups(['absence:read', 'absence_type:read'])]
private string $label = '';
#[ORM\Column(type: 'string', length: 20)]
#[Groups(['absence:read', 'absence_type:read'])]
private string $color = '';
public function getId(): ?int
{
return $this->id;
}
public function getCode(): string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
public function getLabel(): string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getColor(): string
{
return $this->color;
}
public function setColor(string $color): self
{
$this->color = $color;
return $this;
}
}