src/Entity/Product.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. //use ApiPlatform\Core\Annotation\ApiFilter;
  6. //use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  7. //use ApiPlatform\Core\Annotation\ApiResource;
  8. use ApiPlatform\Metadata\ApiResource;
  9. #[ApiResource]
  10. #[ORM\Table(name:"product")]
  11. #[ORM\Entity(repositoryClassProductRepository::class)]
  12. class Product
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column(name"id")]
  17.     private ?int $id;
  18.     #[ORM\Column(name:"nom"type:"string"length:50nullable:true)]
  19.     private ?string $nom;
  20.     #[ORM\Column(name:"description"type:"string"length:1000nullable:true)]
  21.     private ?string $description;
  22.     #[ORM\Column(name:"prix"type:"float"precision:2nullable:true)]
  23.     private ?float $prix;
  24.     #[ORM\Column(name:"qte_stock"type:"integer"nullable:true)]
  25.     private ?int $qteStock;
  26.     #[ORM\Column(name:"image"type:"string"length:500nullable:true)]  
  27.     private ?string $image;
  28.     
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getNom(): ?string
  34.     {
  35.         return $this->nom;
  36.     }
  37.     public function setNom(string $nom): self
  38.     {
  39.         $this->nom $nom;
  40.         return $this;
  41.     }
  42.     public function getDescription(): ?string
  43.     {
  44.         return $this->description;
  45.     }
  46.     public function setDescription(string $description): self
  47.     {
  48.         $this->description $description;
  49.         return $this;
  50.     }
  51.     public function getPrix(): ?int
  52.     {
  53.         return $this->prix;
  54.     }
  55.     public function setPrix(int $prix): self
  56.     {
  57.         $this->prix $prix;
  58.         return $this;
  59.     }
  60.     public function getQteStock(): ?int
  61.     {
  62.         return $this->qteStock;
  63.     }
  64.     public function setQteStock(int $qteStock): self
  65.     {
  66.         $this->qteStock $qteStock;
  67.         return $this;
  68.     }
  69.     public function getImage(): ?string
  70.     {
  71.         return $this->image;
  72.     }
  73.     public function setImage(string $image): self
  74.     {
  75.         $this->image $image;
  76.         return $this;
  77.     }
  78. }