<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\ProductRepository;
use Doctrine\ORM\Mapping as ORM;
use ProxyManager\ProxyGenerator\ValueHolder\MethodGenerator\Constructor;
#[ORM\Entity(repositoryClass: ProductRepository::class)]
#[ApiResource]
class Product
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $image = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $price = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $description = null;
#[ORM\Column(nullable: true)]
private ?\DateTimeImmutable $created_at = null;
#[ORM\Column(nullable: true)]
private ?bool $is_new = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $categorie = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $ref = null;
public function __construct() {
$this->created_at = new \DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getPrice(): ?string
{
return $this->price;
}
public function setPrice(?string $price): self
{
$this->price = $price;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(?\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function isIsNew(): ?bool
{
return $this->is_new;
}
public function setIsNew(?bool $is_new): self
{
$this->is_new = $is_new;
return $this;
}
public function getCategorie(): ?string
{
return $this->categorie;
}
public function setCategorie(?string $categorie): self
{
$this->categorie = $categorie;
return $this;
}
public function getRef(): ?string
{
return $this->ref;
}
public function setRef(?string $ref): self
{
$this->ref = $ref;
return $this;
}
}