src/Entity/AdapterContent.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AdapterContentRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. #[ORM\Entity(repositoryClassAdapterContentRepository::class)]
  9. class AdapterContent
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\JoinTable(name'adapterContent_webContent')]
  16.     #[ORM\JoinColumn(name'adapterContent_id'referencedColumnName'id')]
  17.     #[ORM\InverseJoinColumn(name'webContent_id'referencedColumnName'id'uniquetrue)]
  18.     #[ORM\ManyToMany(targetEntity'WebContent')]
  19.     private Collection $webContents;
  20.     #[ORM\OneToOne(targetEntityProduct::class, mappedBy'adapterContent')]
  21.     private ?Product $product null;
  22.     #[ORM\OneToOne(targetEntityService::class, mappedBy'adapterContent')]
  23.     private ?Service $service null;
  24.     #[ORM\OneToOne(targetEntityReport::class, mappedBy'adapterContent')]
  25.     private ?Report $report null;
  26.     #[ORM\OneToOne(targetEntityPackage::class, mappedBy'adapterContent')]
  27.     private ?Package $package null;
  28.     #[ORM\OneToOne(targetEntityCategory::class, mappedBy'adapterContent')]
  29.     private ?Category $category null;
  30.     public function __construct()
  31.     {
  32.         $this->webContents = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int { return $this->id; }
  35.     public function getWebContents(): Collection { return $this->webContents; }
  36.     public function addWebContent(WebContent $webContent): static { 
  37.         if (!$this->webContents->contains($webContent)) {
  38.             $this->webContents->add($webContent);
  39.         }
  40.         return $this;
  41.     }
  42.     public function removeWebContent(WebContent $webContent): static { 
  43.         $this->webContents->removeElement($webContent);
  44.         return $this;
  45.     }
  46.     public function getProduct(): ?Product { return $this->product; }
  47.     public function setProduct(?Product $product): static { $this->product $product; return $this; }
  48.     public function getService(): ?Service { return $this->service; }
  49.     public function setService(?Service $service): static { $this->service $service; return $this; }
  50.     public function getReport(): ?Report { return $this->report; }
  51.     public function setReport(?Report $report): static { $this->report $report; return $this; }
  52.     public function getCategory(): ?Category { return $this->category; }
  53.     public function setCategory(?Category $category): static { $this->category $category; return $this; }
  54.     public function getPackage(): ?Package { return $this->package; }
  55.     public function setPackage(?Package $package): static { $this->package $package; return $this; }
  56. }