<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\ProductOutRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=ProductOutRepository::class)
* @ApiResource(
* normalizationContext={"groups"={"product_out:read"}},
* denormalizationContext={"groups"={"product_out:write"}},
* )
*/
class ProductOut
{
use TimestampableEntity;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"product:read"})
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="productOuts")
* @Groups({"product_out:read", "product_out:write"})
*/
private $product;
/**
* @ORM\Column(type="integer")
* @Groups({"product_out:read", "product_out:write"})
*/
private $qty;
/**
* @ORM\Column(type="date")
* @Groups({"product_out:read", "product_out:write"})
*/
private $date;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="productOuts")
* @Groups({"product_out:read", "product_out:write"})
*/
private $user;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"product_out:read", "product_out:write"})
*/
private $orderRef;
public function getId(): ?int
{
return $this->id;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getQty(): ?int
{
return $this->qty;
}
public function setQty(int $qty): self
{
$this->qty = $qty;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getOrderRef(): ?string
{
return $this->orderRef;
}
public function setOrderRef(?string $orderRef): self
{
$this->orderRef = $orderRef;
return $this;
}
}