<?php
namespace App\Entity;
use App\Repository\BasketItemsRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: BasketItemsRepository::class)]
class BasketItems
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Baskets::class, inversedBy: 'basketItems')]
private $basket;
#[ORM\ManyToOne(targetEntity: Products::class, inversedBy: 'basketItems')]
private $product;
#[ORM\ManyToOne(targetEntity: Distributors::class, inversedBy: 'basketItems')]
private $distributor;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\Column(type: 'integer')]
private $qty;
#[ORM\Column(type: 'float')]
private $unitPrice;
#[ORM\Column(type: 'float')]
private $total;
#[ORM\Column(type: 'datetime')]
private $modified;
#[ORM\Column(type: 'datetime')]
private $created;
#[ORM\Column(type: 'string', length: 255)]
private $itemId;
public function __construct()
{
$this->setModified(new \DateTime());
if ($this->getCreated() == null) {
$this->setCreated(new \DateTime());
}
}
public function getId(): ?int
{
return $this->id;
}
public function getBasket(): ?Baskets
{
return $this->basket;
}
public function setBasket(?Baskets $basket): self
{
$this->basket = $basket;
return $this;
}
public function getProduct(): ?Products
{
return $this->product;
}
public function setProduct(?Products $product): self
{
$this->product = $product;
return $this;
}
public function getDistributor(): ?Distributors
{
return $this->distributor;
}
public function setDistributor(?Distributors $distributor): self
{
$this->distributor = $distributor;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getQty(): ?int
{
return $this->qty;
}
public function setQty(int $qty): self
{
$this->qty = $qty;
return $this;
}
public function getUnitPrice(): ?float
{
return $this->unitPrice;
}
public function setUnitPrice(float $unitPrice): self
{
$this->unitPrice = $unitPrice;
return $this;
}
public function getTotal(): ?float
{
return $this->total;
}
public function setTotal(float $total): self
{
$this->total = $total;
return $this;
}
public function getModified(): ?\DateTimeInterface
{
return $this->modified;
}
public function setModified(\DateTimeInterface $modified): self
{
$this->modified = $modified;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function getItemId(): ?string
{
return $this->itemId;
}
public function setItemId(string $itemId): self
{
$this->itemId = $itemId;
return $this;
}
}