src/Entity/Product.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\ProductRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use ProxyManager\ProxyGenerator\ValueHolder\MethodGenerator\Constructor;
  7. #[ORM\Entity(repositoryClassProductRepository::class)]
  8. #[ApiResource]
  9. class Product
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $name null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $image null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $price null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $description null;
  23.     #[ORM\Column(nullabletrue)]
  24.     private ?\DateTimeImmutable $created_at null;
  25.     #[ORM\Column(nullabletrue)]
  26.     private ?bool $is_new null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $categorie null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $ref null;
  31.     
  32.     public  function __construct() {
  33.         
  34.         $this->created_at = new \DateTimeImmutable();
  35.     }
  36.      
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getName(): ?string
  42.     {
  43.         return $this->name;
  44.     }
  45.     public function setName(?string $name): self
  46.     {
  47.         $this->name $name;
  48.         return $this;
  49.     }
  50.     public function getImage(): ?string
  51.     {
  52.         return $this->image;
  53.     }
  54.     public function setImage(?string $image): self
  55.     {
  56.         $this->image $image;
  57.         return $this;
  58.     }
  59.     public function getPrice(): ?string
  60.     {
  61.         return $this->price;
  62.     }
  63.     public function setPrice(?string $price): self
  64.     {
  65.         $this->price $price;
  66.         return $this;
  67.     }
  68.     public function getDescription(): ?string
  69.     {
  70.         return $this->description;
  71.     }
  72.     public function setDescription(?string $description): self
  73.     {
  74.         $this->description $description;
  75.         return $this;
  76.     }
  77.     public function getCreatedAt(): ?\DateTimeImmutable
  78.     {
  79.         return $this->created_at;
  80.     }
  81.     public function setCreatedAt(?\DateTimeImmutable $created_at): self
  82.     {
  83.         $this->created_at $created_at;
  84.         return $this;
  85.     }
  86.     public function isIsNew(): ?bool
  87.     {
  88.         return $this->is_new;
  89.     }
  90.     public function setIsNew(?bool $is_new): self
  91.     {
  92.         $this->is_new $is_new;
  93.         return $this;
  94.     }
  95.     public function getCategorie(): ?string
  96.     {
  97.         return $this->categorie;
  98.     }
  99.     public function setCategorie(?string $categorie): self
  100.     {
  101.         $this->categorie $categorie;
  102.         return $this;
  103.     }
  104.     public function getRef(): ?string
  105.     {
  106.         return $this->ref;
  107.     }
  108.     public function setRef(?string $ref): self
  109.     {
  110.         $this->ref $ref;
  111.         return $this;
  112.     }
  113. }