<?php
namespace App\Entity;
use App\Repository\ProductRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProductRepository::class)]
#[ORM\Table(name: "product")]
#[ORM\Index(columns: ["name", "short_description", "long_description", "additional_information"], flags: ["fulltext"])]
class Product
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(nullable: true)]
private ?float $price = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $short_description = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $long_description = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $additional_information = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $main_image_link = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $image_0_link = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $image_1_link = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $image_2_link = null;
#[ORM\ManyToOne(inversedBy: 'product')]
private ?Category $category = null;
#[ORM\Column]
private ?float $weight = null;
#[ORM\Column(length: 2)]
private ?string $weight_unit = null;
#[ORM\Column]
private ?int $stock = null;
#[ORM\Column]
private ?bool $customizable = null;
public function __construct()
{
$this->customizable = false;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getPrice(): ?float
{
return $this->price;
}
public function setPrice(?float $price): static
{
$this->price = $price;
return $this;
}
public function getShortDescription(): ?string
{
return $this->short_description;
}
public function setShortDescription(?string $short_description): static
{
$this->short_description = $short_description;
return $this;
}
public function getLongDescription(): ?string
{
return $this->long_description;
}
public function setLongDescription(?string $long_description): static
{
$this->long_description = $long_description;
return $this;
}
public function getAdditionalInformation(): ?string
{
return $this->additional_information;
}
public function setAdditionalInformation(?string $additional_information): static
{
$this->additional_information = $additional_information;
return $this;
}
public function getMainImageLink(): ?string
{
return $this->main_image_link;
}
public function setMainImageLink(?string $main_image_link): static
{
$this->main_image_link = $main_image_link;
return $this;
}
public function getImage0Link(): ?string
{
return $this->image_0_link;
}
public function setImage0Link(?string $image_0_link): static
{
$this->image_0_link = $image_0_link;
return $this;
}
public function getImage1Link(): ?string
{
return $this->image_1_link;
}
public function setImage1Link(?string $image_1_link): static
{
$this->image_1_link = $image_1_link;
return $this;
}
public function getImage2Link(): ?string
{
return $this->image_2_link;
}
public function setImage2Link(?string $image_2_link): static
{
$this->image_2_link = $image_2_link;
return $this;
}
public function getCategory(): ?Category
{
return $this->category;
}
public function setCategory(?Category $category): static
{
$this->category = $category;
return $this;
}
public function getWeight(): ?float
{
return $this->weight;
}
public function setWeight(float $weight): static
{
$this->weight = $weight;
return $this;
}
public function getWeightUnit(): ?string
{
return $this->weight_unit;
}
public function setWeightUnit(string $weight_unit): static
{
$this->weight_unit = $weight_unit;
return $this;
}
public function getStock(): ?int
{
return $this->stock;
}
public function setStock(int $stock): static
{
$this->stock = $stock;
return $this;
}
public function isCustomizable(): ?bool
{
return $this->customizable;
}
public function setCustomizable(bool $customizable): static
{
$this->customizable = $customizable;
return $this;
}
}