src/Entity/Product.php line 12
<?phpnamespace 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)]class Product{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $product_reference = null;#[ORM\Column(length: 255)]private ?string $product_name = null;#[ORM\Column(length: 1000)]private ?string $product_description = null;#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)]private ?string $product_price = null;#[ORM\Column]private ?int $product_quantity = null;#[ORM\OneToMany(mappedBy: 'order_item_product', targetEntity: OrderItem::class)]private Collection $order_items;#[ORM\OneToMany(mappedBy: 'image_product', targetEntity: Image::class)]private Collection $images;#[ORM\ManyToOne(inversedBy: 'products')]#[ORM\JoinColumn(nullable: false)]private ?Condition $product_condition = null;#[ORM\ManyToOne(inversedBy: 'products')]#[ORM\JoinColumn(nullable: false)]private ?Category $product_category = null;#[ORM\ManyToOne(inversedBy: 'products')]#[ORM\JoinColumn(nullable: false)]private ?Model $product_model = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $product_added_date = null;#[ORM\ManyToMany(targetEntity: Tag::class, inversedBy: 'tag_products')]private Collection $product_tags;#[ORM\Column(nullable: true)]private ?string $product_year = null;#[ORM\Column(nullable: true)]private ?int $product_km = null;#[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2)]private ?string $product_weight = null;public function __construct(){$this->order_items = new ArrayCollection();$this->images = new ArrayCollection();$this->product_tags = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getProductReference(): ?string{return $this->product_reference;}public function setProductReference(string $product_reference): self{$this->product_reference = $product_reference;return $this;}public function getProductName(): ?string{return $this->product_name;}public function setProductName(string $product_name): self{$this->product_name = $product_name;return $this;}public function getProductDescription(): ?string{return $this->product_description;}public function setProductDescription(string $product_description): self{$this->product_description = $product_description;return $this;}public function getProductPrice(): ?string{return $this->product_price;}public function setProductPrice(string $product_price): self{$this->product_price = $product_price;return $this;}public function getProductQuantity(): ?int{return $this->product_quantity;}public function setProductQuantity(int $product_quantity): self{$this->product_quantity = $product_quantity;return $this;}/*** @return Collection<int, OrderItem>*/public function getOrderItems(): Collection{return $this->order_items;}public function addOrderItem(OrderItem $orderItem): self{if (!$this->order_items->contains($orderItem)) {$this->order_items->add($orderItem);$orderItem->setOrderItemProduct($this);}return $this;}public function removeOrderItem(OrderItem $orderItem): self{if ($this->order_items->removeElement($orderItem)) {// set the owning side to null (unless already changed)if ($orderItem->getOrderItemProduct() === $this) {$orderItem->setOrderItemProduct(null);}}return $this;}/*** @return Collection<int, Image>*/public function getImages(): Collection{return $this->images;}public function addImage(Image $image): self{if (!$this->images->contains($image)) {$this->images->add($image);$image->setImageProduct($this);}return $this;}public function removeImage(Image $image): self{if ($this->images->removeElement($image)) {// set the owning side to null (unless already changed)if ($image->getImageProduct() === $this) {$image->setImageProduct(null);}}return $this;}public function getProductCondition(): ?Condition{return $this->product_condition;}public function setProductCondition(?Condition $product_condition): self{$this->product_condition = $product_condition;return $this;}public function getProductCategory(): ?Category{return $this->product_category;}public function setProductCategory(?Category $product_category): self{$this->product_category = $product_category;return $this;}public function getProductModel(): ?Model{return $this->product_model;}public function setProductModel(?Model $product_model): self{$this->product_model = $product_model;return $this;}public function getProductAddedDate(): ?\DateTimeInterface{return $this->product_added_date;}public function setProductAddedDate(\DateTimeInterface $product_added_date): self{$this->product_added_date = $product_added_date;return $this;}public function getBrand(): ?String{return $this->product_model->getModelBrand()->getBrandName();}public function getModel(): ?String{return $this->product_model->getModelName();}public function getCondition(): ?String{return $this->product_condition->getConditionTitle();}/*** @return Collection<int, Tag>*/public function getProductTags(): Collection{return $this->product_tags;}public function addProductTag(Tag $productTag): self{if (!$this->product_tags->contains($productTag)) {$this->product_tags->add($productTag);}return $this;}public function removeProductTag(Tag $productTag): self{$this->product_tags->removeElement($productTag);return $this;}public function getProductYear(): ?string{return $this->product_year;}public function setProductYear(?string $product_year): self{$this->product_year = $product_year;return $this;}public function getProductKm(): ?int{return $this->product_km;}public function setProductKm(?int $product_km): self{$this->product_km = $product_km;return $this;}public function getProductWeight(): ?string{return $this->product_weight;}public function setProductWeight(string $product_weight): self{$this->product_weight = $product_weight;return $this;}public function __toString(): string{return $this->getProductName();}}