src/Entity/Gasto.php line 15

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\Component\Uid\Uuid;
  6. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\GastoRepository")
  8. * @ORM\Table(name="gasto", schema="perseo")
  9. * @ORM\EntityListeners({"App\EntityListener\Gasto\CalcularPrecioTotalRelojListener"})
  10. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  11. */
  12. class Gasto
  13. {
  14. /**
  15. * @ORM\Id
  16. * @ORM\Column(type="uuid", unique=true)
  17. * @ORM\GeneratedValue(strategy="CUSTOM")
  18. * @ORM\CustomIdGenerator(class="doctrine.uuid_generator")
  19. */
  20. protected $id;
  21. /**
  22. * @ORM\Column(type="float", nullable=false, precision=2, options={"default":"0.00"})
  23. */
  24. protected $precio;
  25. /**
  26. * @ORM\Column(type="text", nullable=true)
  27. */
  28. protected $descripcion;
  29. /**
  30. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  31. */
  32. protected $deletedAt;
  33. /**
  34. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  35. * @Gedmo\Timestampable(on="update")
  36. */
  37. protected $updatedAt;
  38. /**
  39. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  40. * @Gedmo\Timestampable(on="create")
  41. */
  42. protected $createdAt;
  43. /**
  44. * @ORM\ManyToOne(targetEntity="App\Entity\TipoCargoAbstract", inversedBy="gastos")
  45. * @ORM\JoinColumn(name="tipo_cargo_id", referencedColumnName="id")
  46. */
  47. protected $tipoCargo;
  48. /**
  49. * @ORM\ManyToOne(targetEntity="App\Entity\Reloj", inversedBy="gastos")
  50. * @ORM\JoinColumn(name="reloj_id", referencedColumnName="id", nullable=false)
  51. */
  52. protected $reloj;
  53. public function getId(): ?Uuid
  54. {
  55. return $this->id;
  56. }
  57. public function getPrecio(): ?float
  58. {
  59. return $this->precio;
  60. }
  61. public function setPrecio(float $precio): self
  62. {
  63. $this->precio = $precio;
  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. public function getTipoCargo(): ?TipoCargoAbstract
  103. {
  104. return $this->tipoCargo;
  105. }
  106. public function setTipoCargo(?TipoCargoAbstract $tipoCargo): self
  107. {
  108. $this->tipoCargo = $tipoCargo;
  109. return $this;
  110. }
  111. public function getReloj(): ?Reloj
  112. {
  113. return $this->reloj;
  114. }
  115. public function setReloj(?Reloj $reloj): self
  116. {
  117. $this->reloj = $reloj;
  118. return $this;
  119. }
  120. }