src/Entity/CategoriaEvento.php line 13

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\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity
  9. */
  10. class CategoriaEvento
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\Column(type="integer")
  15. * @ORM\GeneratedValue(strategy="AUTO")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", nullable=true)
  20. */
  21. private $nombre;
  22. /**
  23. * @ORM\Column(type="string", nullable=true)
  24. */
  25. private $alias;
  26. /**
  27. * @ORM\Column(type="array", nullable=true)
  28. */
  29. private $role;
  30. /**
  31. * @ORM\ManyToMany(targetEntity=\App\Entity\Evento::class, mappedBy="categoriasevento")
  32. */
  33. private $eventos;
  34. public function __construct()
  35. {
  36. $this->eventos = new ArrayCollection();
  37. }
  38. public function getId(): ?int
  39. {
  40. return $this->id;
  41. }
  42. public function setId($id)
  43. {
  44. $this->id = $id;
  45. return $this;
  46. }
  47. public function getNombre(): ?string
  48. {
  49. return $this->nombre;
  50. }
  51. public function setNombre(?string $nombre): static
  52. {
  53. $this->nombre = $nombre;
  54. return $this;
  55. }
  56. public function getAlias(): ?string
  57. {
  58. return $this->alias;
  59. }
  60. public function setAlias(?string $alias): static
  61. {
  62. $this->alias = $alias;
  63. return $this;
  64. }
  65. public function getRole(): ?array
  66. {
  67. return $this->role;
  68. }
  69. public function setRole(?array $role): static
  70. {
  71. $this->role = $role;
  72. return $this;
  73. }
  74. /**
  75. * @return Collection<int, Evento>
  76. */
  77. public function getEventos(): Collection
  78. {
  79. return $this->eventos;
  80. }
  81. public function addEvento(Evento $evento): static
  82. {
  83. if (!$this->eventos->contains($evento)) {
  84. $this->eventos->add($evento);
  85. $evento->addCategoriaEvento($this);
  86. }
  87. return $this;
  88. }
  89. public function removeEvento(Evento $evento): static
  90. {
  91. if ($this->eventos->removeElement($evento)) {
  92. $evento->removeCategoriaEvento($this);
  93. }
  94. return $this;
  95. }
  96. }