Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
212
/
root
/
proc
/
self
/
root
/
proc
/
212
/
root
/
proc
/
self
/
root
/
proc
/
70528
/
cwd
/
src
/
Entity
/
//proc/212/root/proc/self/root/proc/212/root/proc/self/root/proc/70528/cwd/src/Entity/Product.php
<?php namespace App\Entity; use Doctrine\ORM\Mapping as ORM; use App\Repository\ProductRepository; use Doctrine\Common\Collections\Collection; use Symfony\Component\HttpFoundation\File\File; use Doctrine\Common\Collections\ArrayCollection; use Vich\UploaderBundle\Mapping\Annotation as Vich; use Vich\UploaderBundle\Mapping\Annotation\Uploadable; use Vich\UploaderBundle\Mapping\Annotation\UploadableField; /** * @ORM\Entity(repositoryClass=ProductRepository::class) * @Vich\Uploadable */ class Product { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255) */ private $alt; /** * @ORM\Column(type="string", length=1024) */ private $description; /** * NOTE: This is not a mapped field of entity metadata, just a simple property. * * @Vich\UploadableField(mapping="product_main_image", fileNameProperty="cover") * * @var File|null */ private $imageFile; /** * @ORM\Column(type="text", nullable="true") */ private $cover; /** * @ORM\OneToMany(targetEntity=ProductImage::class, mappedBy="product", orphanRemoval=true) */ private $productImages; /** * @ORM\Column(type="boolean") */ private $availableForDelivery; /** * @ORM\OneToMany(targetEntity=Size::class, mappedBy="product", orphanRemoval=true) */ private $sizes; /** * @ORM\OneToMany(targetEntity=Quantity::class, mappedBy="product", orphanRemoval=true) */ private $quantities; /** * @ORM\ManyToOne(targetEntity=Category::class, inversedBy="products") */ private $category; /** * @ORM\Column(type="datetime", nullable="true") */ private $updatedAt; /** * @ORM\ManyToMany(targetEntity=Grammage::class, inversedBy="products", cascade={"remove"}) */ private $grammages; /** * @ORM\OneToMany(targetEntity=Fold::class, mappedBy="product", orphanRemoval=true) */ private $folds; /** * @ORM\OneToMany(targetEntity=Page::class, mappedBy="product", orphanRemoval=true) */ private $pages; /** * @ORM\OneToMany(targetEntity=Color::class, mappedBy="product") */ private $colors; /** * @ORM\OneToMany(targetEntity=Finishing::class, mappedBy="product", orphanRemoval=true) */ private $finishings; /** * @ORM\Column(type="boolean") */ private $active; /** * @ORM\OneToMany(targetEntity=Price::class, mappedBy="product", orphanRemoval=true) */ private $prices; /** * @ORM\Column(type="text", nullable=true) */ private $longDesc; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $meta_title; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $meta_description; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $meta_keywords; /** * @ORM\Column(type="boolean", nullable=true) */ private $mockupAvailable; public function __construct() { $this->productImages = new ArrayCollection(); $this->sizes = new ArrayCollection(); $this->quantities = new ArrayCollection(); $this->updatedAt = new \DateTime(); $this->grammages = new ArrayCollection(); $this->folds = new ArrayCollection(); $this->pages = new ArrayCollection(); $this->finishings = new ArrayCollection(); $this->colors = new ArrayCollection(); $this->poses = new ArrayCollection(); $this->active = true; $this->prices = new ArrayCollection(); } 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 getAlt(): ?string { return $this->alt; } public function setAlt(string $alt): self { $this->alt = $alt; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(string $description): self { $this->description = $description; return $this; } public function setImageFile(?File $imageFile = null): void { $this->imageFile = $imageFile; if (null !== $imageFile) { // It is required that at least one field changes if you are using doctrine // otherwise the event listeners won't be called and the file is lost $this->updatedAt = new \DateTimeImmutable(); } } public function getImageFile(): ?File { return $this->imageFile; } public function getCover(): ?string { return $this->cover; } public function setCover(?string $cover): self { $this->cover = $cover; return $this; } /** * @return Collection<int, ProductImage> */ public function getProductImages(): Collection { return $this->productImages; } public function addProductImage(ProductImage $productImage): self { if (!$this->productImages->contains($productImage)) { $this->productImages[] = $productImage; $productImage->setProduct($this); } return $this; } public function removeProductImage(ProductImage $productImage): self { if ($this->productImages->removeElement($productImage)) { // set the owning side to null (unless already changed) if ($productImage->getProduct() === $this) { $productImage->setProduct(null); } } return $this; } public function isAvailableForDelivery(): ?bool { return $this->availableForDelivery; } public function setAvailableForDelivery(bool $availableForDelivery): self { $this->availableForDelivery = $availableForDelivery; return $this; } /** * @return Collection<int, Size> */ public function getSizes(): Collection { return $this->sizes; } public function addSize(Size $size): self { if (!$this->sizes->contains($size)) { $this->sizes[] = $size; $size->setProduct($this); } return $this; } public function removeSize(Size $size): self { if ($this->sizes->removeElement($size)) { // set the owning side to null (unless already changed) if ($size->getProduct() === $this) { $size->setProduct(null); } } return $this; } /** * @return Collection<int, Quantity> */ public function getQuantities(): Collection { return $this->quantities; } public function addQuantity(Quantity $quantity): self { if (!$this->quantities->contains($quantity)) { $this->quantities[] = $quantity; $quantity->setProduct($this); } return $this; } public function removeQuantity(Quantity $quantity): self { if ($this->quantities->removeElement($quantity)) { // set the owning side to null (unless already changed) if ($quantity->getProduct() === $this) { $quantity->setProduct(null); } } return $this; } public function getCategory(): ?Category { return $this->category; } public function setCategory(?Category $category): self { $this->category = $category; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } /** * @return Collection<int, Grammage> */ public function getGrammages(): Collection { return $this->grammages; } public function addGrammage(Grammage $grammage): self { if (!$this->grammages->contains($grammage)) { $this->grammages[] = $grammage; } return $this; } public function removeGrammage(Grammage $grammage): self { $this->grammages->removeElement($grammage); return $this; } /** * @return Collection<int, Fold> */ public function getFolds(): Collection { return $this->folds; } public function addFold(Fold $fold): self { if (!$this->folds->contains($fold)) { $this->folds[] = $fold; $fold->setProduct($this); } return $this; } public function removeFold(Fold $fold): self { if ($this->folds->removeElement($fold)) { // set the owning side to null (unless already changed) if ($fold->getProduct() === $this) { $fold->setProduct(null); } } return $this; } /** * @return Collection<int, Page> */ public function getPages(): Collection { return $this->pages; } public function addPage(Page $page): self { if (!$this->pages->contains($page)) { $this->pages[] = $page; $page->setProduct($this); } return $this; } public function removePage(Page $page): self { if ($this->pages->removeElement($page)) { // set the owning side to null (unless already changed) if ($page->getProduct() === $this) { $page->setProduct(null); } } return $this; } /** * @return Collection<int, Color> */ public function getColors(): Collection { return $this->colors; } public function addColor(Color $color): self { if (!$this->colors->contains($color)) { $this->colors[] = $color; $color->setProduct($this); } return $this; } public function removeColor(Color $color): self { if ($this->colors->removeElement($color)) { // set the owning side to null (unless already changed) if ($color->getProduct() === $this) { $color->setProduct(null); } } return $this; } /** * @return Collection<int, Finishing> */ public function getFinishings(): Collection { return $this->finishings; } public function addFinishing(Finishing $finishing): self { if (!$this->finishings->contains($finishing)) { $this->finishings[] = $finishing; $finishing->setProduct($this); } return $this; } public function removeFinishing(Finishing $finishing): self { if ($this->finishings->removeElement($finishing)) { // set the owning side to null (unless already changed) if ($finishing->getProduct() === $this) { $finishing->setProduct(null); } } return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } /** * @return Collection<int, Price> */ public function getPrices(): Collection { return $this->prices; } public function addPrice(Price $price): self { if (!$this->prices->contains($price)) { $this->prices[] = $price; $price->setProduct($this); } return $this; } public function removePrice(Price $price): self { if ($this->prices->removeElement($price)) { // set the owning side to null (unless already changed) if ($price->getProduct() === $this) { $price->setProduct(null); } } return $this; } public function getLongDesc(): ?string { return $this->longDesc; } public function setLongDesc(?string $longDesc): self { $this->longDesc = $longDesc; return $this; } public function getMetaTitle(): ?string { return $this->meta_title; } public function setMetaTitle(?string $meta_title): self { $this->meta_title = $meta_title; return $this; } public function getMetaDescription(): ?string { return $this->meta_description; } public function setMetaDescription(?string $meta_description): self { $this->meta_description = $meta_description; return $this; } public function getMetaKeywords(): ?string { return $this->meta_keywords; } public function setMetaKeywords(?string $meta_keywords): self { $this->meta_keywords = $meta_keywords; return $this; } public function isMockupAvailable(): ?bool { return $this->mockupAvailable; } public function setMockupAvailable(?bool $mockupAvailable): self { $this->mockupAvailable = $mockupAvailable; return $this; } }