src/Entity/Intercambio.php line 16

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. use Gedmo\Mapping\Annotation as Gedmo;
  7. use Symfony\Component\Uid\Uuid;
  8. /**
  9. * @ORM\Entity(repositoryClass="App\Repository\IntercambioRepository")
  10. * @ORM\Table(name="intercambio", schema="perseo")
  11. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12. */
  13. class Intercambio
  14. {
  15. /**
  16. * @ORM\Id
  17. * @ORM\Column(type="uuid", unique=true)
  18. * @ORM\GeneratedValue(strategy="CUSTOM")
  19. * @ORM\CustomIdGenerator(class="doctrine.uuid_generator")
  20. */
  21. private $id;
  22. /**
  23. * @ORM\Column(type="string", length=2, nullable=true)
  24. */
  25. private $idioma;
  26. /**
  27. * @ORM\Column(
  28. * type="string",
  29. * nullable=true,
  30. * options={"comment":"Tipo de contrato, pudiendo ser Gestión, Compra ó Permuta"}
  31. * )
  32. */
  33. private $contrato;
  34. /**
  35. * @ORM\Column(type="string", nullable=true)
  36. */
  37. private $nombre;
  38. /**
  39. * @ORM\Column(type="text", nullable=true, name="descripcion")
  40. */
  41. private $descripcion;
  42. /**
  43. * @ORM\Column(type="text", nullable=true, name="descripcion_privada")
  44. */
  45. private $descripcionPrivada;
  46. /**
  47. * @ORM\Column(type="boolean", nullable=true)
  48. */
  49. private $active;
  50. /**
  51. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  52. */
  53. private $deletedAt;
  54. /**
  55. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  56. * @Gedmo\Timestampable(on="update")
  57. */
  58. private $updatedAt;
  59. /**
  60. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  61. * @Gedmo\Timestampable(on="create")
  62. */
  63. private $createdAt;
  64. /**
  65. * @ORM\OneToMany(targetEntity="App\Entity\Operacion", mappedBy="intercambio")
  66. */
  67. private $operaciones;
  68. public function __construct()
  69. {
  70. $this->operaciones = new ArrayCollection();
  71. }
  72. public function __toString(): string
  73. {
  74. return $this->getNombre() ?? '---';
  75. }
  76. public function getId(): ?Uuid
  77. {
  78. return $this->id;
  79. }
  80. public function getNombre(): ?string
  81. {
  82. return $this->nombre;
  83. }
  84. public function setNombre(?string $nombre): self
  85. {
  86. $this->nombre = $nombre;
  87. return $this;
  88. }
  89. public function getDeletedAt(): ?\DateTimeInterface
  90. {
  91. return $this->deletedAt;
  92. }
  93. public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  94. {
  95. $this->deletedAt = $deletedAt;
  96. return $this;
  97. }
  98. public function getUpdatedAt(): ?\DateTimeInterface
  99. {
  100. return $this->updatedAt;
  101. }
  102. public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  103. {
  104. $this->updatedAt = $updatedAt;
  105. return $this;
  106. }
  107. public function getCreatedAt(): ?\DateTimeInterface
  108. {
  109. return $this->createdAt;
  110. }
  111. public function setCreatedAt(\DateTimeInterface $createdAt): self
  112. {
  113. $this->createdAt = $createdAt;
  114. return $this;
  115. }
  116. /**
  117. * @return Collection|Operacion[]
  118. */
  119. public function getOperaciones(): Collection
  120. {
  121. return $this->operaciones;
  122. }
  123. public function addOperacione(Operacion $operacione): self
  124. {
  125. if (!$this->operaciones->contains($operacione)) {
  126. $this->operaciones[] = $operacione;
  127. $operacione->setIntercambio($this);
  128. }
  129. return $this;
  130. }
  131. public function removeOperacione(Operacion $operacione): self
  132. {
  133. if ($this->operaciones->removeElement($operacione)) {
  134. // set the owning side to null (unless already changed)
  135. if ($operacione->getIntercambio() === $this) {
  136. $operacione->setIntercambio(null);
  137. }
  138. }
  139. return $this;
  140. }
  141. public function getDescripcion(): ?string
  142. {
  143. return $this->descripcion;
  144. }
  145. public function setDescripcion(?string $descripcion): static
  146. {
  147. $this->descripcion = $descripcion;
  148. return $this;
  149. }
  150. public function getDescripcionPrivada(): ?string
  151. {
  152. return $this->descripcionPrivada;
  153. }
  154. public function setDescripcionPrivada(?string $descripcionPrivada): static
  155. {
  156. $this->descripcionPrivada = $descripcionPrivada;
  157. return $this;
  158. }
  159. public function isActive(): ?bool
  160. {
  161. return $this->active;
  162. }
  163. public function setActive(?bool $active): static
  164. {
  165. $this->active = $active;
  166. return $this;
  167. }
  168. public function getIdioma(): ?string
  169. {
  170. return $this->idioma;
  171. }
  172. public function setIdioma(?string $idioma): static
  173. {
  174. $this->idioma = $idioma;
  175. return $this;
  176. }
  177. public function getContrato(): ?string
  178. {
  179. return $this->contrato;
  180. }
  181. public function setContrato(?string $contrato): static
  182. {
  183. $this->contrato = $contrato;
  184. return $this;
  185. }
  186. }