src/Entity/GrupoEdadUsuario.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\GrupoEdadUsuarioRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClass: GrupoEdadUsuarioRepository::class)]
  8. class GrupoEdadUsuario
  9. {
  10. #[ORM\Id]
  11. #[ORM\GeneratedValue]
  12. #[ORM\Column(type: 'integer')]
  13. private $id;
  14. #[ORM\Column(type: 'string', length: 255)]
  15. private ?string $nombre = null;
  16. #[ORM\Column(type: 'boolean')]
  17. private bool $visible = true;
  18. #[ORM\Column(type: 'boolean')]
  19. private bool $borrado = false;
  20. #[ORM\Column(type: 'integer')]
  21. private ?int $min = null;
  22. #[ORM\Column(type: 'integer')]
  23. private ?int $max = null;
  24. #[ORM\OneToMany(targetEntity: SOLICITUD::class, mappedBy: 'grupoEdad')]
  25. private Collection $solicitudes;
  26. public function __construct()
  27. {
  28. $this->solicitudes = new ArrayCollection();
  29. }
  30. public function getId(): ?int
  31. {
  32. return $this->id;
  33. }
  34. public function getNombre(): ?string
  35. {
  36. return $this->nombre;
  37. }
  38. public function setNombre(string $nombre): self
  39. {
  40. $this->nombre = $nombre;
  41. return $this;
  42. }
  43. public function isVisible(): ?bool
  44. {
  45. return $this->visible;
  46. }
  47. public function setVisible(bool $visible): self
  48. {
  49. $this->visible = $visible;
  50. return $this;
  51. }
  52. public function isBorrado(): ?bool
  53. {
  54. return $this->borrado;
  55. }
  56. public function setBorrado(bool $borrado): self
  57. {
  58. $this->borrado = $borrado;
  59. return $this;
  60. }
  61. public function getMin(): ?int
  62. {
  63. return $this->min;
  64. }
  65. public function setMin(int $min): self
  66. {
  67. $this->min = $min;
  68. return $this;
  69. }
  70. public function getMax(): ?int
  71. {
  72. return $this->max;
  73. }
  74. public function setMax(int $max): self
  75. {
  76. $this->max = $max;
  77. return $this;
  78. }
  79. /**
  80. * @return Collection<int, SOLICITUD>
  81. */
  82. public function getSolicitudes(): Collection
  83. {
  84. return $this->solicitudes;
  85. }
  86. public function addSolicitude(SOLICITUD $solicitude): self
  87. {
  88. if (!$this->solicitudes->contains($solicitude)) {
  89. $this->solicitudes[] = $solicitude;
  90. $solicitude->setGrupoEdad($this);
  91. }
  92. return $this;
  93. }
  94. public function removeSolicitude(SOLICITUD $solicitude): self
  95. {
  96. // set the owning side to null (unless already changed)
  97. if ($this->solicitudes->removeElement($solicitude) && $solicitude->getGrupoEdad() === $this) {
  98. $solicitude->setGrupoEdad(null);
  99. }
  100. return $this;
  101. }
  102. }