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/Category.php
<?php namespace App\Entity; use Doctrine\ORM\Mapping as ORM; use App\Repository\CategoryRepository; 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=CategoryRepository::class) * @Vich\Uploadable */ class Category { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\OneToMany(targetEntity=Product::class, mappedBy="category") */ private $products; /** * @ORM\Column(type="boolean") */ private $active; /** * @ORM\Column(type="datetime", nullable="true") */ private $updatedAt; /** * @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; public function __construct() { $this->products = new ArrayCollection(); $this->updatedAt = new \DateTime(); } 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; } /** * @return Collection<int, Product> */ public function getProducts(): Collection { return $this->products; } public function addProduct(Product $product): self { if (!$this->products->contains($product)) { $this->products[] = $product; $product->setCategory($this); } return $this; } public function removeProduct(Product $product): self { if ($this->products->removeElement($product)) { // set the owning side to null (unless already changed) if ($product->getCategory() === $this) { $product->setCategory(null); } } return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; 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; } }