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