src/Entity/ViewProduitQteStock.php line 56

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ViewProduitQteStockRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use JsonSerializable;
  6. #[ORM\Entity(repositoryClass: ViewProduitQteStockRepository::class)]
  7. class ViewProduitQteStock implements JsonSerializable
  8. {
  9. #[ORM\Id]
  10. #[ORM\GeneratedValue]
  11. #[ORM\Column(type: 'integer')]
  12. private $id;
  13. #[ORM\OneToOne(targetEntity: Product::class, inversedBy: 'produitQteStock', cascade: ['persist', 'remove'])]
  14. #[ORM\JoinColumn(nullable: false)]
  15. private $produit;
  16. #[ORM\Column(type: 'integer')]
  17. private $qteStock;
  18. #[ORM\Column(type: 'integer')]
  19. private $isAvailableStock;
  20. public function getId(): ?int
  21. {
  22. return $this->id;
  23. }
  24. public function getProduit(): ?Product
  25. {
  26. return $this->produit;
  27. }
  28. public function setProduit(Product $produit): self
  29. {
  30. $this->produit = $produit;
  31. return $this;
  32. }
  33. public function getQteStock(): ?int
  34. {
  35. return $this->qteStock;
  36. }
  37. public function setQteStock(int $qteStock): self
  38. {
  39. $this->qteStock = $qteStock;
  40. return $this;
  41. }
  42. public function jsonSerialize()
  43. {
  44. return ["id" => $this->getId(), "qteStock" => $this->getQteStock()];
  45. }
  46. /**
  47. * Get the value of isAvailableStock
  48. */
  49. public function getIsAvailableStock()
  50. {
  51. return $this->isAvailableStock;
  52. }
  53. /**
  54. * Set the value of isAvailableStock
  55. *
  56. * @return self
  57. */
  58. public function setIsAvailableStock($isAvailableStock)
  59. {
  60. $this->isAvailableStock = $isAvailableStock;
  61. return $this;
  62. }
  63. }