src/Entity/CartItems.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use phpDocumentor\Reflection\Types\Integer;
  8. #[ORM\Entity]
  9. //#[ORM\Entity(repositoryClass: CartItemsRepository::class)]
  10. #[ORM\Table(name"cartitems"indexes: [
  11.     new ORM\Index(name"cartId"columns: ["cartId"]),
  12.     new ORM\Index(name"productId"columns: ["productId"]),
  13. ])]
  14. class CartItems
  15. {
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue(strategy"IDENTITY")]
  18.     #[ORM\Column(name"id"type"integer")]
  19.     private ?int $id null;
  20.  
  21.     #[Assert\NotNull]
  22.     #[ORM\ManyToOne(targetEntityCarts::class)]
  23.     #[ORM\JoinColumn(name"cartId"referencedColumnName"id")]
  24.     private ?Carts $cartId null;
  25.     #[Assert\NotNull]
  26.     #[ORM\ManyToOne(targetEntityProducts::class)]
  27.     #[ORM\JoinColumn(name"productId"referencedColumnName"id")]
  28.     private ?Products $productId null;
  29.     #[Assert\NotBlank]
  30.     #[ORM\Column(name"qty"type"integer",  nullabletrue)]
  31.     private ?string $qty null;
  32.  
  33.     #[Assert\NotBlank]
  34.     #[ORM\Column(name"prix"type"integer",  nullabletrue)]
  35.     private ?string $prix null;
  36.  
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.  
  42.     public function getCartId(): ?Carts
  43.     {
  44.         return $this->cartId;
  45.     }
  46.     public function setCartId(?Carts $cartId): static
  47.     {
  48.         $this->cartId $cartId;
  49.         return $this;
  50.     }
  51.     public function getProductId(): ?Souscategorie
  52.     {
  53.         return $this->productId;
  54.     }
  55.     public function setProductId(?Souscategorie $productId): static
  56.     {
  57.         $this->productId $productId;
  58.         return $this;
  59.     }
  60.   
  61.     
  62.     public function getQty(): ?int
  63.     {
  64.         return $this->qty;
  65.     }
  66.     public function setQty(?int $qty): static
  67.     {
  68.         $this->qty $qty;
  69.         return $this;
  70.     }
  71.    
  72.    
  73.         
  74.     public function getPrix(): ?int
  75.     {
  76.         return $this->prix;
  77.     }
  78.     public function setPrix(?int $prix): static
  79.     {
  80.         $this->prix $prix;
  81.         return $this;
  82.     }
  83.  
  84.  
  85.   
  86. }