src/Entity/TipoAccion.php line 17

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. use Gedmo\Mapping\Annotation as Gedmo;
  8. use Symfony\Component\Uid\Uuid;
  9. /**
  10. * @ORM\Entity(repositoryClass="App\Repository\TipoAccionRepository")
  11. * @ORM\Table(name="tipo_accion", schema="perseo")
  12. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  13. */
  14. class TipoAccion
  15. {
  16. /**
  17. * @ORM\Id
  18. * @ORM\Column(type="uuid", unique=true)
  19. * @ORM\GeneratedValue(strategy="CUSTOM")
  20. * @ORM\CustomIdGenerator(class="doctrine.uuid_generator")
  21. */
  22. private $id;
  23. /**
  24. * @ORM\Column(type="string", nullable=true)
  25. */
  26. private $nombre;
  27. /**
  28. * @ORM\Column(type="text", nullable=true)
  29. */
  30. private $descripcion;
  31. /**
  32. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  33. */
  34. private $deletedAt;
  35. /**
  36. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  37. * @Gedmo\Timestampable(on="update")
  38. */
  39. private $updatedAt;
  40. /**
  41. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  42. * @Gedmo\Timestampable(on="create")
  43. */
  44. private $createdAt;
  45. /**
  46. * @ORM\OneToMany(targetEntity="App\Entity\AccionAbstract", mappedBy="tipoAccion")
  47. */
  48. private $acciones;
  49. public function __construct()
  50. {
  51. $this->acciones = new ArrayCollection();
  52. }
  53. public function getId(): ?Uuid
  54. {
  55. return $this->id;
  56. }
  57. public function getNombre(): ?string
  58. {
  59. return $this->nombre;
  60. }
  61. public function setNombre(?string $nombre): self
  62. {
  63. $this->nombre = $nombre;
  64. return $this;
  65. }
  66. public function getDescripcion(): ?string
  67. {
  68. return $this->descripcion;
  69. }
  70. public function setDescripcion(?string $descripcion): self
  71. {
  72. $this->descripcion = $descripcion;
  73. return $this;
  74. }
  75. public function getDeletedAt(): ?\DateTimeInterface
  76. {
  77. return $this->deletedAt;
  78. }
  79. public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  80. {
  81. $this->deletedAt = $deletedAt;
  82. return $this;
  83. }
  84. public function getUpdatedAt(): ?\DateTimeInterface
  85. {
  86. return $this->updatedAt;
  87. }
  88. public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  89. {
  90. $this->updatedAt = $updatedAt;
  91. return $this;
  92. }
  93. public function getCreatedAt(): ?\DateTimeInterface
  94. {
  95. return $this->createdAt;
  96. }
  97. public function setCreatedAt(\DateTimeInterface $createdAt): self
  98. {
  99. $this->createdAt = $createdAt;
  100. return $this;
  101. }
  102. /**
  103. * @return Collection<int, AccionAbstract>
  104. */
  105. public function getAcciones(): Collection
  106. {
  107. return $this->acciones;
  108. }
  109. public function addAccione(AccionAbstract $accione): self
  110. {
  111. if (!$this->acciones->contains($accione)) {
  112. $this->acciones->add($accione);
  113. $accione->setTipoAccion($this);
  114. }
  115. return $this;
  116. }
  117. public function removeAccione(AccionAbstract $accione): self
  118. {
  119. if ($this->acciones->removeElement($accione)) {
  120. // set the owning side to null (unless already changed)
  121. if ($accione->getTipoAccion() === $this) {
  122. $accione->setTipoAccion(null);
  123. }
  124. }
  125. return $this;
  126. }
  127. }