src/Entity/Banco.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\BancoRepository")
  10. * @ORM\Table(name="banco", schema="perseo")
  11. * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12. */
  13. class Banco
  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", nullable=true)
  24. */
  25. private $nombre;
  26. /**
  27. * @ORM\Column(type="string", nullable=true)
  28. */
  29. private $entidad;
  30. /**
  31. * @ORM\Column(type="string", nullable=true)
  32. */
  33. private $ciudad;
  34. /**
  35. * @ORM\Column(type="string", nullable=true)
  36. */
  37. private $iban;
  38. /**
  39. * @ORM\Column(type="string", nullable=true)
  40. */
  41. private $swift;
  42. /**
  43. * @ORM\Column(type="string", nullable=true)
  44. */
  45. private $propietario;
  46. /**
  47. * @ORM\Column(type="string", nullable=true)
  48. */
  49. private $vat;
  50. /**
  51. * @ORM\Column(type="boolean", nullable=true)
  52. */
  53. private $active;
  54. /**
  55. * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  56. */
  57. private $deletedAt;
  58. /**
  59. * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  60. * @Gedmo\Timestampable(on="update")
  61. */
  62. private $updatedAt;
  63. /**
  64. * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  65. * @Gedmo\Timestampable(on="create")
  66. */
  67. private $createdAt;
  68. /**
  69. * @ORM\OneToMany(targetEntity="App\Entity\Operacion", mappedBy="banco")
  70. */
  71. private $operaciones;
  72. /*
  73. * @ORM\ManyToOne(targetEntity="App\Entity\Ciudad", inversedBy="bancos")
  74. * @ORM\JoinColumn(name="ciudad_id", referencedColumnName="id")
  75. */
  76. //private $ciudad;
  77. public function __construct()
  78. {
  79. $this->operaciones = new ArrayCollection();
  80. }
  81. public function __toString(): string
  82. {
  83. return $this->getEntidad()??'---';
  84. }
  85. public function getId(): ?Uuid
  86. {
  87. return $this->id;
  88. }
  89. public function getEntidad(): ?string
  90. {
  91. return $this->entidad;
  92. }
  93. public function setEntidad(?string $entidad): self
  94. {
  95. $this->entidad = $entidad;
  96. return $this;
  97. }
  98. public function getIban(): ?string
  99. {
  100. return $this->iban;
  101. }
  102. public function setIban(?string $iban): self
  103. {
  104. $this->iban = $iban;
  105. return $this;
  106. }
  107. public function getSwift(): ?string
  108. {
  109. return $this->swift;
  110. }
  111. public function setSwift(?string $swift): self
  112. {
  113. $this->swift = $swift;
  114. return $this;
  115. }
  116. public function getPropietario(): ?string
  117. {
  118. return $this->propietario;
  119. }
  120. public function setPropietario(?string $propietario): self
  121. {
  122. $this->propietario = $propietario;
  123. return $this;
  124. }
  125. public function getVat(): ?string
  126. {
  127. return $this->vat;
  128. }
  129. public function setVat(?string $vat): self
  130. {
  131. $this->vat = $vat;
  132. return $this;
  133. }
  134. public function getActive(): ?bool
  135. {
  136. return $this->active;
  137. }
  138. public function setActive(?bool $active): self
  139. {
  140. $this->active = $active;
  141. return $this;
  142. }
  143. public function getDeletedAt(): ?\DateTimeInterface
  144. {
  145. return $this->deletedAt;
  146. }
  147. public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  148. {
  149. $this->deletedAt = $deletedAt;
  150. return $this;
  151. }
  152. public function getUpdatedAt(): ?\DateTimeInterface
  153. {
  154. return $this->updatedAt;
  155. }
  156. public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  157. {
  158. $this->updatedAt = $updatedAt;
  159. return $this;
  160. }
  161. public function getCreatedAt(): ?\DateTimeInterface
  162. {
  163. return $this->createdAt;
  164. }
  165. public function setCreatedAt(\DateTimeInterface $createdAt): self
  166. {
  167. $this->createdAt = $createdAt;
  168. return $this;
  169. }
  170. /**
  171. * @return Collection|Operacion[]
  172. */
  173. public function getOperaciones(): Collection
  174. {
  175. return $this->operaciones;
  176. }
  177. public function addOperacione(Operacion $operacione): self
  178. {
  179. if (!$this->operaciones->contains($operacione)) {
  180. $this->operaciones[] = $operacione;
  181. $operacione->setBanco($this);
  182. }
  183. return $this;
  184. }
  185. public function removeOperacione(Operacion $operacione): self
  186. {
  187. if ($this->operaciones->removeElement($operacione)) {
  188. // set the owning side to null (unless already changed)
  189. if ($operacione->getBanco() === $this) {
  190. $operacione->setBanco(null);
  191. }
  192. }
  193. return $this;
  194. }
  195. public function getCiudad(): ?string
  196. {
  197. return $this->ciudad;
  198. }
  199. public function setCiudad(?string $ciudad): self
  200. {
  201. $this->ciudad = $ciudad;
  202. return $this;
  203. }
  204. public function isActivo(): ?bool
  205. {
  206. return $this->activo;
  207. }
  208. public function getNombre(): ?string
  209. {
  210. return $this->nombre;
  211. }
  212. public function setNombre(?string $nombre): static
  213. {
  214. $this->nombre = $nombre;
  215. return $this;
  216. }
  217. public function isActive(): ?bool
  218. {
  219. return $this->active;
  220. }
  221. }