src/Entity/BasketItems.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BasketItemsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassBasketItemsRepository::class)]
  6. class BasketItems
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntityBaskets::class, inversedBy'basketItems')]
  13.     private $basket;
  14.     #[ORM\ManyToOne(targetEntityProducts::class, inversedBy'basketItems')]
  15.     private $product;
  16.     #[ORM\ManyToOne(targetEntityDistributors::class, inversedBy'basketItems')]
  17.     private $distributor;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $name;
  20.     #[ORM\Column(type'integer')]
  21.     private $qty;
  22.     #[ORM\Column(type'float')]
  23.     private $unitPrice;
  24.     #[ORM\Column(type'float')]
  25.     private $total;
  26.     #[ORM\Column(type'datetime')]
  27.     private $modified;
  28.     #[ORM\Column(type'datetime')]
  29.     private $created;
  30.     #[ORM\Column(type'string'length255)]
  31.     private $itemId;
  32.     public function __construct()
  33.     {
  34.         $this->setModified(new \DateTime());
  35.         if ($this->getCreated() == null) {
  36.             $this->setCreated(new \DateTime());
  37.         }
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getBasket(): ?Baskets
  44.     {
  45.         return $this->basket;
  46.     }
  47.     public function setBasket(?Baskets $basket): self
  48.     {
  49.         $this->basket $basket;
  50.         return $this;
  51.     }
  52.     public function getProduct(): ?Products
  53.     {
  54.         return $this->product;
  55.     }
  56.     public function setProduct(?Products $product): self
  57.     {
  58.         $this->product $product;
  59.         return $this;
  60.     }
  61.     public function getDistributor(): ?Distributors
  62.     {
  63.         return $this->distributor;
  64.     }
  65.     public function setDistributor(?Distributors $distributor): self
  66.     {
  67.         $this->distributor $distributor;
  68.         return $this;
  69.     }
  70.     public function getName(): ?string
  71.     {
  72.         return $this->name;
  73.     }
  74.     public function setName(string $name): self
  75.     {
  76.         $this->name $name;
  77.         return $this;
  78.     }
  79.     public function getQty(): ?int
  80.     {
  81.         return $this->qty;
  82.     }
  83.     public function setQty(int $qty): self
  84.     {
  85.         $this->qty $qty;
  86.         return $this;
  87.     }
  88.     public function getUnitPrice(): ?float
  89.     {
  90.         return $this->unitPrice;
  91.     }
  92.     public function setUnitPrice(float $unitPrice): self
  93.     {
  94.         $this->unitPrice $unitPrice;
  95.         return $this;
  96.     }
  97.     public function getTotal(): ?float
  98.     {
  99.         return $this->total;
  100.     }
  101.     public function setTotal(float $total): self
  102.     {
  103.         $this->total $total;
  104.         return $this;
  105.     }
  106.     public function getModified(): ?\DateTimeInterface
  107.     {
  108.         return $this->modified;
  109.     }
  110.     public function setModified(\DateTimeInterface $modified): self
  111.     {
  112.         $this->modified $modified;
  113.         return $this;
  114.     }
  115.     public function getCreated(): ?\DateTimeInterface
  116.     {
  117.         return $this->created;
  118.     }
  119.     public function setCreated(\DateTimeInterface $created): self
  120.     {
  121.         $this->created $created;
  122.         return $this;
  123.     }
  124.     public function getItemId(): ?string
  125.     {
  126.         return $this->itemId;
  127.     }
  128.     public function setItemId(string $itemId): self
  129.     {
  130.         $this->itemId $itemId;
  131.         return $this;
  132.     }
  133. }