src/Entity/Intercambio.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\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\IntercambioRepository")
  10.  * @ORM\Table(name="intercambio", schema="perseo")
  11.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  12.  */
  13. class Intercambio
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\Column(type="bigint", options={"unsigned":true})
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string", length=2, nullable=true)
  23.      */
  24.     private $idioma;
  25.     /**
  26.      * @ORM\Column(
  27.      *     type="string",
  28.      *     nullable=true,
  29.      *     options={"comment":"Tipo de contrato, pudiendo ser Gestión, Compra ó Permuta"}
  30.      * )
  31.      */
  32.     private $contrato;
  33.     /**
  34.      * @ORM\Column(type="string", nullable=true)
  35.      */
  36.     private $nombre;
  37.     /**
  38.      * @ORM\Column(type="text", nullable=true, name="descripcion")
  39.      */
  40.     private $descripcion;
  41.     /**
  42.      * @ORM\Column(type="text", nullable=true, name="descripcion_privada")
  43.      */
  44.     private $descripcionPrivada;
  45.     /**
  46.      * @ORM\Column(type="boolean", nullable=true)
  47.      */
  48.     private $active;
  49.     /**
  50.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  51.      */
  52.     private $deletedAt;
  53.     /**
  54.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  55.      * @Gedmo\Timestampable(on="update")
  56.      */
  57.     private $updatedAt;
  58.     /**
  59.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  60.      * @Gedmo\Timestampable(on="create")
  61.      */
  62.     private $createdAt;
  63.     /**
  64.      * @ORM\OneToMany(targetEntity="App\Entity\Operacion", mappedBy="intercambio")
  65.      */
  66.     private $operaciones;
  67.     public function __construct()
  68.     {
  69.         $this->operaciones = new ArrayCollection();
  70.     }
  71.     public function __toString(): string
  72.     {
  73.         return $this->getNombre() ?? '---';
  74.     }
  75.     public function getId(): ?string
  76.     {
  77.         return $this->id;
  78.     }
  79.     public function getNombre(): ?string
  80.     {
  81.         return $this->nombre;
  82.     }
  83.     public function setNombre(?string $nombre): self
  84.     {
  85.         $this->nombre $nombre;
  86.         return $this;
  87.     }
  88.     public function getDeletedAt(): ?\DateTimeInterface
  89.     {
  90.         return $this->deletedAt;
  91.     }
  92.     public function setDeletedAt(?\DateTimeInterface $deletedAt): self
  93.     {
  94.         $this->deletedAt $deletedAt;
  95.         return $this;
  96.     }
  97.     public function getUpdatedAt(): ?\DateTimeInterface
  98.     {
  99.         return $this->updatedAt;
  100.     }
  101.     public function setUpdatedAt(\DateTimeInterface $updatedAt): self
  102.     {
  103.         $this->updatedAt $updatedAt;
  104.         return $this;
  105.     }
  106.     public function getCreatedAt(): ?\DateTimeInterface
  107.     {
  108.         return $this->createdAt;
  109.     }
  110.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  111.     {
  112.         $this->createdAt $createdAt;
  113.         return $this;
  114.     }
  115.     /**
  116.      * @return Collection|Operacion[]
  117.      */
  118.     public function getOperaciones(): Collection
  119.     {
  120.         return $this->operaciones;
  121.     }
  122.     public function addOperacione(Operacion $operacione): self
  123.     {
  124.         if (!$this->operaciones->contains($operacione)) {
  125.             $this->operaciones[] = $operacione;
  126.             $operacione->setIntercambio($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function removeOperacione(Operacion $operacione): self
  131.     {
  132.         if ($this->operaciones->removeElement($operacione)) {
  133.             // set the owning side to null (unless already changed)
  134.             if ($operacione->getIntercambio() === $this) {
  135.                 $operacione->setIntercambio(null);
  136.             }
  137.         }
  138.         return $this;
  139.     }
  140.     public function getDescripcion(): ?string
  141.     {
  142.         return $this->descripcion;
  143.     }
  144.     public function setDescripcion(?string $descripcion): static
  145.     {
  146.         $this->descripcion $descripcion;
  147.         return $this;
  148.     }
  149.     public function getDescripcionPrivada(): ?string
  150.     {
  151.         return $this->descripcionPrivada;
  152.     }
  153.     public function setDescripcionPrivada(?string $descripcionPrivada): static
  154.     {
  155.         $this->descripcionPrivada $descripcionPrivada;
  156.         return $this;
  157.     }
  158.     public function isActive(): ?bool
  159.     {
  160.         return $this->active;
  161.     }
  162.     public function setActive(?bool $active): static
  163.     {
  164.         $this->active $active;
  165.         return $this;
  166.     }
  167.     public function getIdioma(): ?string
  168.     {
  169.         return $this->idioma;
  170.     }
  171.     public function setIdioma(?string $idioma): static
  172.     {
  173.         $this->idioma $idioma;
  174.         return $this;
  175.     }
  176.     public function getContrato(): ?string
  177.     {
  178.         return $this->contrato;
  179.     }
  180.     public function setContrato(?string $contrato): static
  181.     {
  182.         $this->contrato $contrato;
  183.         return $this;
  184.     }
  185. }