src/Entity/Product.php line 11
<?phpnamespace App\Entity;use App\Repository\ProductRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ProductRepository::class)]class Product{#[ORM\Id, ORM\GeneratedValue, ORM\Column(type: 'integer')]private int $id;#[ORM\Column(type: 'string', length: 255)]private string $name;#[ORM\Column(type: 'float')]private float $damagedPrice;#[ORM\Column(type: 'float')]private float $normalPrice;#[ORM\Column(type: 'float')]private float $excellentPrice;#[ORM\Column(type: 'boolean')]private bool $accepted;#[ORM\Column(type: 'float', nullable: true)]private ?float $weight;#[ORM\Column(type: 'integer', nullable: true)]private ?int $pspId;#[ORM\ManyToOne(targetEntity: ProductCategorie::class, inversedBy: 'product')]#[ORM\JoinColumn(nullable: false)]private $productCategorie;#[ORM\OneToMany(targetEntity: ProductTag::class, mappedBy: 'product', orphanRemoval: true)]private Collection $productTags;#[ORM\ManyToOne(targetEntity: ProductBrand::class, inversedBy: 'product')]#[ORM\JoinColumn(nullable: false)]private $productBrand;#[ORM\OneToMany(targetEntity: ProductTradeIn::class, mappedBy: 'product', orphanRemoval: true)]private Collection $productTradeIns;#[ORM\Column(type: 'boolean')]private bool $is_active;public function __construct(){$this->productTags = new ArrayCollection();$this->productTradeIns = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getName(): ?string{if(isset($this->name)) {return $this->name;}return "";}public function setName(string $name): self{$this->name = $name;return $this;}public function getDamagedPrice(): ?float{return $this->damagedPrice;}public function setDamagedPrice(float $damagedPrice): self{$this->damagedPrice = $damagedPrice;return $this;}public function getNormalPrice(): ?float{return $this->normalPrice;}public function setNormalPrice(float $normalPrice): self{$this->normalPrice = $normalPrice;return $this;}public function getExcellentPrice(): ?float{return $this->excellentPrice;}public function setExcellentPrice(float $excellentPrice): self{$this->excellentPrice = $excellentPrice;return $this;}public function getAccepted(): ?bool{return $this->accepted;}public function setAccepted(bool $accepted): self{$this->accepted = $accepted;return $this;}public function getWeight(): ?float{return $this->weight;}public function setWeight(?float $weight): self{$this->weight = $weight;return $this;}public function getPspId(): ?int{return $this->pspId;}public function setPspId(?int $pspId): self{$this->pspId = $pspId;return $this;}public function getProductCategorie(): ?ProductCategorie{return $this->productCategorie;}public function setProductCategorie(?ProductCategorie $productCategorie): self{$this->productCategorie = $productCategorie;return $this;}/*** @return Collection|ProductTag[]*/public function getProductTags(): Collection{return $this->productTags;}public function addProductTag(ProductTag $productTag): self{if (!$this->productTags->contains($productTag)) {$this->productTags[] = $productTag;$productTag->setProduct($this);}return $this;}public function removeProductTag(ProductTag $productTag): self{if ($this->productTags->removeElement($productTag)) {// set the owning side to null (unless already changed)if ($productTag->getProduct() === $this) {$productTag->setProduct(null);}}return $this;}public function getProductBrand(): ?ProductBrand{return $this->productBrand;}public function setProductBrand(?ProductBrand $productBrand): self{$this->productBrand = $productBrand;return $this;}/*** @return Collection|ProductTradeIn[]*/public function getProductTradeIns(): Collection{return $this->productTradeIns;}public function addProductTradeIn(ProductTradeIn $productTradeIn): self{if (!$this->productTradeIns->contains($productTradeIn)) {$this->productTradeIns[] = $productTradeIn;$productTradeIn->setProduct($this);}return $this;}public function removeProductTradeIn(ProductTradeIn $productTradeIn): self{if ($this->productTradeIns->removeElement($productTradeIn)) {// set the owning side to null (unless already changed)if ($productTradeIn->getProduct() === $this) {$productTradeIn->setProduct(null);}}return $this;}public function getIsActive(): ?bool{return $this->is_active;}public function setIsActive(bool $is_active): self{$this->is_active = $is_active;return $this;}}