src/Entity/InvitacionInstitucion.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Core\Entity\Institucion\Director;
  4. use App\Core\Entity\Institucion\Institucion;
  5. use App\Repository\InvitacionInstitucionRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. /**
  10. * @ORM\Entity(repositoryClass=InvitacionInstitucionRepository::class)
  11. */
  12. class InvitacionInstitucion
  13. {
  14. /**
  15. * @ORM\Id
  16. * @ORM\GeneratedValue
  17. * @ORM\Column(type="integer")
  18. */
  19. private $id;
  20. /**
  21. * @ORM\ManyToOne(targetEntity=Institucion::class, inversedBy="invitacionInstitucions")
  22. */
  23. private $institucion;
  24. /**
  25. * @ORM\Column(type="integer")
  26. */
  27. private $estado;
  28. /**
  29. * @ORM\Column(type="string", length=100, nullable=true)
  30. */
  31. private $email;
  32. /**
  33. * @ORM\ManyToOne(targetEntity=Director::class, inversedBy="invitacionInstitucions")
  34. */
  35. private $director;
  36. /**
  37. * @ORM\Column(type="integer", nullable=true)
  38. * 1: Coadministrador a institución existente
  39. * 2: Coordinador
  40. */
  41. private $role;
  42. /**
  43. * @ORM\OneToMany(targetEntity=InvitacionInstitucionPermisos::class, mappedBy="invitacion")
  44. */
  45. private $invitacionInstitucionPermisos;
  46. public function __construct()
  47. {
  48. $this->invitacionInstitucionPermisos = new ArrayCollection();
  49. }
  50. public function getId(): ?int
  51. {
  52. return $this->id;
  53. }
  54. public function getInstitucion(): ?Institucion
  55. {
  56. return $this->institucion;
  57. }
  58. public function setInstitucion(?Institucion $institucion): self
  59. {
  60. $this->institucion = $institucion;
  61. return $this;
  62. }
  63. public function getEstado(): ?int
  64. {
  65. return $this->estado;
  66. }
  67. public function setEstado(int $estado): self
  68. {
  69. $this->estado = $estado;
  70. return $this;
  71. }
  72. public function getEmail(): ?string
  73. {
  74. return $this->email;
  75. }
  76. public function setEmail(?string $email): self
  77. {
  78. $this->email = $email;
  79. return $this;
  80. }
  81. public function getDirector(): ?Director
  82. {
  83. return $this->director;
  84. }
  85. public function setDirector(?Director $director): self
  86. {
  87. $this->director = $director;
  88. return $this;
  89. }
  90. public function getRole(): ?int
  91. {
  92. return $this->role;
  93. }
  94. public function setRole(?int $role): self
  95. {
  96. $this->role = $role;
  97. return $this;
  98. }
  99. /**
  100. * @return Collection<int, InvitacionInstitucionPermisos>
  101. */
  102. public function getInvitacionInstitucionPermisos(): Collection
  103. {
  104. return $this->invitacionInstitucionPermisos;
  105. }
  106. public function addInvitacionInstitucionPermiso(InvitacionInstitucionPermisos $invitacionInstitucionPermiso): self
  107. {
  108. if (!$this->invitacionInstitucionPermisos->contains($invitacionInstitucionPermiso)) {
  109. $this->invitacionInstitucionPermisos[] = $invitacionInstitucionPermiso;
  110. $invitacionInstitucionPermiso->setInvitacion($this);
  111. }
  112. return $this;
  113. }
  114. public function removeInvitacionInstitucionPermiso(InvitacionInstitucionPermisos $invitacionInstitucionPermiso): self
  115. {
  116. if ($this->invitacionInstitucionPermisos->removeElement($invitacionInstitucionPermiso)) {
  117. // set the owning side to null (unless already changed)
  118. if ($invitacionInstitucionPermiso->getInvitacion() === $this) {
  119. $invitacionInstitucionPermiso->setInvitacion(null);
  120. }
  121. }
  122. return $this;
  123. }
  124. }