src/Entity/Cartline.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CartlineRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass:CartlineRepository::class)]
  6. class Cartline
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue(strategy:'AUTO')]
  10.     #[ORM\Column(type:'integer'unique:true )]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntity:Cart::class, inversedBy:'cartlines')]
  13.     #[ORM\JoinColumn(nullable:falseonDelete:'CASCADE')]
  14.     private $panier;
  15.     #[ORM\ManyToOne(targetEntity:Product::class, inversedBy:'cartlines')]
  16.     #[ORM\JoinColumn(nullable:falseonDelete:'CASCADE')]
  17.     private $produit;
  18.     #[ORM\Column(type:'integer')]
  19.     private $quantity;
  20.     public function getId(): ?int
  21.     {
  22.         return $this->id;
  23.     }
  24.     public function getPanier(): ?int
  25.     {
  26.         return $this->panier->getId();
  27.     }
  28.     public function setPanier(?Cart $panier): self
  29.     {
  30.         $this->panier $panier;
  31.         return $this;
  32.     }
  33.     public function getProduit(): ?int
  34.     {
  35.         return $this->produit->getId();
  36.     }
  37.     public function setProduit(?Product $produit): self
  38.     {
  39.         $this->produit $produit;
  40.         return $this;
  41.     }
  42.     public function getQuantity(): ?int
  43.     {
  44.         return $this->quantity;
  45.     }
  46.     public function setQuantity(int $quantity): self
  47.     {
  48.         $this->quantity $quantity;
  49.         return $this;
  50.     }
  51. }