src/Entity/CategoriaFormulario.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity
  8. */
  9. class CategoriaFormulario
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\Column(type="integer")
  14. * @ORM\GeneratedValue(strategy="AUTO")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(type="string", nullable=true)
  19. */
  20. private $nombre;
  21. /**
  22. * @ORM\Column(type="string", nullable=true)
  23. */
  24. private $alias;
  25. /**
  26. * @ORM\Column(type="boolean", nullable=true)
  27. */
  28. private $publica;
  29. /**
  30. * @ORM\ManyToMany(targetEntity=\App\Entity\Formulario::class, mappedBy="categorias")
  31. */
  32. private $formularios;
  33. public function __construct()
  34. {
  35. $this->formularios = new ArrayCollection();
  36. }
  37. public function getId(): ?int
  38. {
  39. return $this->id;
  40. }
  41. public function setId($id)
  42. {
  43. $this->id = $id;
  44. return $this;
  45. }
  46. public function getNombre(): ?string
  47. {
  48. return $this->nombre;
  49. }
  50. public function setNombre(?string $nombre): static
  51. {
  52. $this->nombre = $nombre;
  53. return $this;
  54. }
  55. public function getAlias(): ?string
  56. {
  57. return $this->alias;
  58. }
  59. public function setAlias(?string $alias): static
  60. {
  61. $this->alias = $alias;
  62. return $this;
  63. }
  64. public function isPublica(): ?bool
  65. {
  66. return $this->publica;
  67. }
  68. public function setPublica(?bool $publica): static
  69. {
  70. $this->publica = $publica;
  71. return $this;
  72. }
  73. /**
  74. * @return Collection<int, Formulario>
  75. */
  76. public function getFormularios(): Collection
  77. {
  78. return $this->formularios;
  79. }
  80. public function addFormulario(Formulario $formulario): static
  81. {
  82. if (!$this->formularios->contains($formulario)) {
  83. $this->formularios->add($formulario);
  84. $formulario->addCategoria($this);
  85. }
  86. return $this;
  87. }
  88. public function removeFormulario(Formulario $formulario): static
  89. {
  90. if ($this->formularios->removeElement($formulario)) {
  91. $formulario->removeCategoria($this);
  92. }
  93. return $this;
  94. }
  95. }