src/Entity/FielpetPol/Enfermedad.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\FielpetPol;
  3. use App\Entity\Traits\LoggableTrait;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Symfony\Component\HttpFoundation\File\UploadedFile;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  11. use Gedmo\Mapping\Annotation as Gedmo;
  12. /**
  13. * Enfermedad
  14. *
  15. * @ORM\Table(name="enfermedad")
  16. * @ORM\Entity
  17. * @Gedmo\Loggable
  18. */
  19. class Enfermedad
  20. {
  21. /**
  22. * LoggableTrait add add_user_ add_date, edit_user, edit_date
  23. */
  24. use LoggableTrait;
  25. /**
  26. * @var integer
  27. *
  28. * @ORM\Column(name="id", type="integer", nullable=false)
  29. * @ORM\Id
  30. * @ORM\GeneratedValue(strategy="IDENTITY")
  31. */
  32. private $id;
  33. /**
  34. * @var \Policy
  35. *
  36. * @ORM\ManyToOne(targetEntity="Policy", inversedBy="manifestaciones", cascade={"persist"})
  37. * @ORM\JoinColumns({
  38. * @ORM\JoinColumn(name="fk_policy", referencedColumnName="id")
  39. * })
  40. */
  41. private $fkPolicy;
  42. /**
  43. * @var string
  44. *
  45. * @ORM\Column(name="nombre", type="string", length=255, nullable=true)
  46. * @Gedmo\Versioned
  47. */
  48. private $nombre;
  49. /**
  50. * @var string
  51. *
  52. * @ORM\Column(name="observaciones", type="string", length=255, nullable=true)
  53. * @Gedmo\Versioned
  54. */
  55. private $observaciones;
  56. /**
  57. * @ORM\OneToMany(targetEntity="EnfermedadDetalle", mappedBy="fkEnfermedad")
  58. **/
  59. private $detalles;
  60. public function __construct()
  61. {
  62. $this->detalles = new \Doctrine\Common\Collections\ArrayCollection();
  63. }
  64. public function getId(): ?int
  65. {
  66. return $this->id;
  67. }
  68. public function getNombre(): ?string
  69. {
  70. return $this->nombre;
  71. }
  72. public function setNombre(?string $nombre): static
  73. {
  74. $this->nombre = $nombre;
  75. return $this;
  76. }
  77. public function getObservaciones(): ?string
  78. {
  79. return $this->observaciones;
  80. }
  81. public function setObservaciones(?string $observaciones): static
  82. {
  83. $this->observaciones = $observaciones;
  84. return $this;
  85. }
  86. public function getFkPolicy(): ?Policy
  87. {
  88. return $this->fkPolicy;
  89. }
  90. public function setFkPolicy(?Policy $fkPolicy): static
  91. {
  92. $this->fkPolicy = $fkPolicy;
  93. return $this;
  94. }
  95. /**
  96. * @return Collection<int, EnfermedadDetalle>
  97. */
  98. public function getDetalles(): Collection
  99. {
  100. return $this->detalles;
  101. }
  102. public function addDetalle(EnfermedadDetalle $detalle): static
  103. {
  104. if (!$this->detalles->contains($detalle)) {
  105. $this->detalles->add($detalle);
  106. $detalle->setFkEnfermedad($this);
  107. }
  108. return $this;
  109. }
  110. public function removeDetalle(EnfermedadDetalle $detalle): static
  111. {
  112. if ($this->detalles->removeElement($detalle)) {
  113. // set the owning side to null (unless already changed)
  114. if ($detalle->getFkEnfermedad() === $this) {
  115. $detalle->setFkEnfermedad(null);
  116. }
  117. }
  118. return $this;
  119. }
  120. }