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