src/Entity/EstadoAbstract.php line 26

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. use Symfony\Component\Uid\Uuid;
  7. /**
  8. * @ORM\Entity(repositoryClass="App\Repository\EstadoAbstractRepository")
  9. * @ORM\Table(name="estado", schema="perseo")
  10. * @UniqueEntity(fields={"key"})
  11. * @ORM\InheritanceType("SINGLE_TABLE")
  12. * @ORM\DiscriminatorColumn(name="type", type="string")
  13. * @ORM\DiscriminatorMap({
  14. * "valoracion":"App\Entity\EstadoValoracion",
  15. * "reloj":"App\Entity\EstadoReloj",
  16. * "operacion":"App\Entity\EstadoOperacion",
  17. * "aspecto":"App\Entity\EstadoAspecto",
  18. * "check":"App\Entity\EstadoCheck",
  19. * "actividad":"App\Entity\EstadoActividad"
  20. * })
  21. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  22. */
  23. Abstract class EstadoAbstract
  24. {
  25. /**
  26. * @ORM\Id
  27. * @ORM\Column(type="uuid", unique=true)
  28. * @ORM\GeneratedValue(strategy="CUSTOM")
  29. * @ORM\CustomIdGenerator(class="doctrine.uuid_generator")
  30. */
  31. protected $id;
  32. /**
  33. * @ORM\Column(type="string", nullable=false, name="key_estado")
  34. */
  35. protected $key;
  36. /**
  37. * @ORM\Column(type="string", nullable=false)
  38. */
  39. protected $nombre;
  40. /**
  41. * @ORM\Column(type="string", nullable=true)
  42. */
  43. protected $icono;
  44. /**
  45. * @ORM\Column(type="string", nullable=true)
  46. */
  47. protected $color;
  48. /**
  49. * @ORM\Column(type="smallint", nullable=false, options={"default":1,"unsigned":true})
  50. */
  51. protected $orden;
  52. /**
  53. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  54. */
  55. protected $deletedAt;
  56. /**
  57. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2019-01-01 00:00:00"})
  58. * @Gedmo\Timestampable(on="update")
  59. */
  60. protected $updatedAt;
  61. /**
  62. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2019-01-01 00:00:00"})
  63. * @Gedmo\Timestampable(on="create")
  64. */
  65. protected $createdAt;
  66. public function __toString(): string
  67. {
  68. return $this->getNombre();
  69. }
  70. public function getId(): ?Uuid
  71. {
  72. return $this->id;
  73. }
  74. public function getKey(): ?string
  75. {
  76. return $this->key;
  77. }
  78. public function setKey(string $key): self
  79. {
  80. $this->key = $key;
  81. return $this;
  82. }
  83. public function getNombre(): ?string
  84. {
  85. return $this->nombre;
  86. }
  87. public function setNombre(string $nombre): self
  88. {
  89. $this->nombre = $nombre;
  90. return $this;
  91. }
  92. public function getIcono(): ?string
  93. {
  94. return $this->icono;
  95. }
  96. public function setIcono(?string $icono): self
  97. {
  98. $this->icono = $icono;
  99. return $this;
  100. }
  101. public function getColor(): ?string
  102. {
  103. return $this->color;
  104. }
  105. public function setColor(?string $color): self
  106. {
  107. $this->color = $color;
  108. return $this;
  109. }
  110. public function getOrden(): ?int
  111. {
  112. return $this->orden;
  113. }
  114. public function setOrden(int $orden): self
  115. {
  116. $this->orden = $orden;
  117. return $this;
  118. }
  119. public function getDeletedAt(): ?\DateTimeInterface
  120. {
  121. return $this->deletedAt;
  122. }
  123. public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  124. {
  125. $this->deletedAt = $deletedAt;
  126. return $this;
  127. }
  128. public function getUpdatedAt(): ?\DateTimeInterface
  129. {
  130. return $this->updatedAt;
  131. }
  132. public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  133. {
  134. $this->updatedAt = $updatedAt;
  135. return $this;
  136. }
  137. public function getCreatedAt(): ?\DateTimeInterface
  138. {
  139. return $this->createdAt;
  140. }
  141. public function setCreatedAt(\DateTimeInterface $createdAt): self
  142. {
  143. $this->createdAt = $createdAt;
  144. return $this;
  145. }
  146. }