src/Entity/MetodoEntrega.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 Gedmo\Mapping\Annotation as Gedmo;
  8. use JMS\Serializer\Annotation as JMS;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\MetodoEntregaRepository")
  11.  * @ORM\Table(name="metodo_entrega")
  12.  * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
  13.  */
  14. class MetodoEntrega
  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="boolean", nullable=true)
  34.      * @JMS\Groups({
  35.      *      "api_v1_operacion_show_serialize"
  36.      *  })
  37.      */
  38.     private $active;
  39.     /**
  40.      * @ORM\Column(type="datetime", nullable=true, name="deleted_at")
  41.      * @JMS\Groups({
  42.      *      "api_v1_operacion_show_serialize"
  43.      *  })
  44.      */
  45.     private $deletedAt;
  46.     /**
  47.      * @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
  48.      * @Gedmo\Timestampable(on="update")
  49.      */
  50.     private $updatedAt;
  51.     /**
  52.      * @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
  53.      * @Gedmo\Timestampable(on="create")
  54.      */
  55.     private $createdAt;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=\App\Entity\Venta::class, mappedBy="metodoEntrega")
  58.      */
  59.     private $ventas;
  60.     public function __construct()
  61.     {
  62.         $this->ventas = new ArrayCollection();
  63.     }
  64.     public function getId(): ?string
  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 isActive(): ?bool
  78.     {
  79.         return $this->active;
  80.     }
  81.     public function setActive(?bool $active): static
  82.     {
  83.         $this->active $active;
  84.         return $this;
  85.     }
  86.     public function getDeletedAt(): ?\DateTimeInterface
  87.     {
  88.         return $this->deletedAt;
  89.     }
  90.     public function setDeletedAt(?\DateTimeInterface $deletedAt): static
  91.     {
  92.         $this->deletedAt $deletedAt;
  93.         return $this;
  94.     }
  95.     public function getUpdatedAt(): ?\DateTimeInterface
  96.     {
  97.         return $this->updatedAt;
  98.     }
  99.     public function setUpdatedAt(\DateTimeInterface $updatedAt): static
  100.     {
  101.         $this->updatedAt $updatedAt;
  102.         return $this;
  103.     }
  104.     public function getCreatedAt(): ?\DateTimeInterface
  105.     {
  106.         return $this->createdAt;
  107.     }
  108.     public function setCreatedAt(\DateTimeInterface $createdAt): static
  109.     {
  110.         $this->createdAt $createdAt;
  111.         return $this;
  112.     }
  113.     /**
  114.      * @return Collection<int, Venta>
  115.      */
  116.     public function getVentas(): Collection
  117.     {
  118.         return $this->ventas;
  119.     }
  120.     public function addVenta(Venta $venta): static
  121.     {
  122.         if (!$this->ventas->contains($venta)) {
  123.             $this->ventas->add($venta);
  124.             $venta->setMetodoEntrega($this);
  125.         }
  126.         return $this;
  127.     }
  128.     public function removeVenta(Venta $venta): static
  129.     {
  130.         if ($this->ventas->removeElement($venta)) {
  131.             // set the owning side to null (unless already changed)
  132.             if ($venta->getMetodoEntrega() === $this) {
  133.                 $venta->setMetodoEntrega(null);
  134.             }
  135.         }
  136.         return $this;
  137.     }
  138. }