<?php
namespace App\Entity;
use App\Repository\AdapterContentRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: AdapterContentRepository::class)]
class AdapterContent
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\JoinTable(name: 'adapterContent_webContent')]
#[ORM\JoinColumn(name: 'adapterContent_id', referencedColumnName: 'id')]
#[ORM\InverseJoinColumn(name: 'webContent_id', referencedColumnName: 'id', unique: true)]
#[ORM\ManyToMany(targetEntity: 'WebContent')]
private Collection $webContents;
#[ORM\OneToOne(targetEntity: Product::class, mappedBy: 'adapterContent')]
private ?Product $product = null;
#[ORM\OneToOne(targetEntity: Service::class, mappedBy: 'adapterContent')]
private ?Service $service = null;
#[ORM\OneToOne(targetEntity: Report::class, mappedBy: 'adapterContent')]
private ?Report $report = null;
#[ORM\OneToOne(targetEntity: Package::class, mappedBy: 'adapterContent')]
private ?Package $package = null;
#[ORM\OneToOne(targetEntity: Category::class, mappedBy: 'adapterContent')]
private ?Category $category = null;
public function __construct()
{
$this->webContents = new ArrayCollection();
}
public function getId(): ?int { return $this->id; }
public function getWebContents(): Collection { return $this->webContents; }
public function addWebContent(WebContent $webContent): static {
if (!$this->webContents->contains($webContent)) {
$this->webContents->add($webContent);
}
return $this;
}
public function removeWebContent(WebContent $webContent): static {
$this->webContents->removeElement($webContent);
return $this;
}
public function getProduct(): ?Product { return $this->product; }
public function setProduct(?Product $product): static { $this->product = $product; return $this; }
public function getService(): ?Service { return $this->service; }
public function setService(?Service $service): static { $this->service = $service; return $this; }
public function getReport(): ?Report { return $this->report; }
public function setReport(?Report $report): static { $this->report = $report; return $this; }
public function getCategory(): ?Category { return $this->category; }
public function setCategory(?Category $category): static { $this->category = $category; return $this; }
public function getPackage(): ?Package { return $this->package; }
public function setPackage(?Package $package): static { $this->package = $package; return $this; }
}