<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'cart_item')]
#[ORM\Entity(repositoryClass: 'App\Entity\Repository\CartItemRepository')]
class CartItem
{
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
#[ORM\Column(type: 'string', nullable: true)]
private $articlenumber;
#[ORM\Column(type: 'integer', nullable: true)]
private $amount;
#[ORM\Column(type: 'float', nullable: true, precision: 6, scale: 2)]
private $price;
#[ORM\Column(type: 'datetime', nullable: false)]
private $date_created;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Shoparticle', inversedBy: 'cartItem')]
#[ORM\JoinColumn(name: 'shoparticle_id', referencedColumnName: 'id')]
private $shoparticle;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User', inversedBy: 'cartItem')]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false)]
private $user;
public function getId(): ?int
{
return $this->id;
}
public function getArticlenumber(): ?string
{
return $this->articlenumber;
}
public function setArticlenumber(?string $articlenumber): self
{
$this->articlenumber = $articlenumber;
return $this;
}
public function getAmount(): ?int
{
return $this->amount;
}
public function setAmount(?int $amount): self
{
$this->amount = $amount;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(?float $price): self
{
$this->price = $price;
return $this;
}
public function getDateCreated(): ?\DateTimeInterface
{
return $this->date_created;
}
public function setDateCreated(\DateTimeInterface $date_created): self
{
$this->date_created = $date_created;
return $this;
}
public function getShoparticle(): ?Shoparticle
{
return $this->shoparticle;
}
public function setShoparticle(?Shoparticle $shoparticle): self
{
$this->shoparticle = $shoparticle;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
}