FunctionType.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Access;
  4. use App\Repository\Access\FunctionTypeRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8. * Enum des fonctions que peuvent occuper un Access au sein d'une Organization
  9. *
  10. */
  11. #[ORM\Entity(repositoryClass: FunctionTypeRepository::class)]
  12. class FunctionType
  13. {
  14. #[ORM\Id]
  15. #[ORM\GeneratedValue]
  16. #[ORM\Column]
  17. private ?int $id = null;
  18. #[ORM\Column]
  19. #[Assert\Choice(callback: ['\App\Enum\Access\TypeFunctionEnum', 'toArray'], message: 'invalid-function-type')]
  20. private string $functionType;
  21. #[ORM\Column]
  22. #[Assert\Choice(callback: ['\App\Enum\Access\FunctionEnum', 'toArray'], message: 'invalid-function')]
  23. private string $mission;
  24. #[ORM\Column]
  25. #[Assert\Choice(callback: ['\App\Enum\Access\RoleEnum', 'toArray'], message: 'invalid-role')]
  26. private string $roleByDefault;
  27. public function getId(): ?int
  28. {
  29. return $this->id;
  30. }
  31. public function getFunctionType(): string
  32. {
  33. return $this->functionType;
  34. }
  35. public function setFunctionType(string $functionType): self
  36. {
  37. $this->functionType = $functionType;
  38. return $this;
  39. }
  40. public function getMission(): string
  41. {
  42. return $this->mission;
  43. }
  44. public function setMission(string $mission): self
  45. {
  46. $this->mission = $mission;
  47. return $this;
  48. }
  49. public function getRoleByDefault(): string
  50. {
  51. return $this->roleByDefault;
  52. }
  53. public function setRoleByDefault(string $roleByDefault): self
  54. {
  55. $this->roleByDefault = $roleByDefault;
  56. return $this;
  57. }
  58. }