<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use JMS\Serializer\Annotation as JMS;
/**
* @ORM\Entity(repositoryClass="App\Repository\MetodoEntregaRepository")
* @ORM\Table(name="metodo_entrega")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false, hardDelete=true)
*/
class MetodoEntrega
{
/**
* @ORM\Id
* @ORM\Column(type="bigint", options={"unsigned":true})
* @ORM\GeneratedValue(strategy="AUTO")
* @JMS\Groups({
* "api_v1_operacion_show_serialize"
* })
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
* @JMS\Groups({
* "api_v1_operacion_show_serialize"
* })
*/
private $nombre;
/**
* @ORM\Column(type="boolean", nullable=true)
* @JMS\Groups({
* "api_v1_operacion_show_serialize"
* })
*/
private $active;
/**
* @ORM\Column(type="datetime", nullable=true, name="deleted_at")
* @JMS\Groups({
* "api_v1_operacion_show_serialize"
* })
*/
private $deletedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="updated_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="update")
*/
private $updatedAt;
/**
* @ORM\Column(type="datetime", nullable=false, name="created_at", options={"default":"2022-01-01 00:00:00"})
* @Gedmo\Timestampable(on="create")
*/
private $createdAt;
/**
* @ORM\OneToMany(targetEntity=\App\Entity\Venta::class, mappedBy="metodoEntrega")
*/
private $ventas;
public function __construct()
{
$this->ventas = new ArrayCollection();
}
public function getId(): ?string
{
return $this->id;
}
public function getNombre(): ?string
{
return $this->nombre;
}
public function setNombre(?string $nombre): static
{
$this->nombre = $nombre;
return $this;
}
public function isActive(): ?bool
{
return $this->active;
}
public function setActive(?bool $active): static
{
$this->active = $active;
return $this;
}
public function getDeletedAt(): ?\DateTimeInterface
{
return $this->deletedAt;
}
public function setDeletedAt(?\DateTimeInterface $deletedAt): static
{
$this->deletedAt = $deletedAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): static
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
/**
* @return Collection<int, Venta>
*/
public function getVentas(): Collection
{
return $this->ventas;
}
public function addVenta(Venta $venta): static
{
if (!$this->ventas->contains($venta)) {
$this->ventas->add($venta);
$venta->setMetodoEntrega($this);
}
return $this;
}
public function removeVenta(Venta $venta): static
{
if ($this->ventas->removeElement($venta)) {
// set the owning side to null (unless already changed)
if ($venta->getMetodoEntrega() === $this) {
$venta->setMetodoEntrega(null);
}
}
return $this;
}
}