src/Entity/Collection.php line 17
<?phpnamespace App\Entity;use App\Entity\Trait\MainTranslationTrait;use App\Entity\Translation\CollectionTranslation;use App\Entity\Translation\ProductTranslation;use App\Repository\CollectionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Translatable\Translatable;use Gedmo\Mapping\Annotation as Gedmo;#[Gedmo\TranslationEntity(class: self::TRANSLATION_ENTITY)]#[ORM\Entity(repositoryClass: CollectionRepository::class)]class Collection implements Translatable{use MainTranslationTrait;const TRANSLATION_ENTITY = CollectionTranslation::class;public function __toString(): string{return $this->title ?? '';}#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\OneToMany(mappedBy: 'collection', targetEntity: Product::class)]private \Doctrine\Common\Collections\Collection $products;#[ORM\Column(type: 'string',nullable: true)]#[Gedmo\Translatable]private ?string $title = null;#[ORM\Column(type: 'text',nullable: true)]#[Gedmo\Translatable]private mixed $description = null;public function __construct(){$this->products = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getTitle(): ?string{return $this->title;}public function setTitle(?string $title): self{$this->title = $title;return $this;}public function getProducts(): \Doctrine\Common\Collections\Collection{return $this->products;}public function addProduct(Product $product): self{if (!$this->products->contains($product)) {$this->products->add($product);$product->setCollection($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->getCollection() === $this) {$product->setCollection(null);}}return $this;}/*** @return mixed|null*/public function getDescription(): mixed{return $this->description;}/*** @param mixed|null $description*/public function setDescription(mixed $description): void{$this->description = $description;}}