src/Entity/Product.php line 13
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\ProductRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ProductRepository::class)]#[ApiResource]class Product{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $productName = null;#[ORM\Column]private ?int $historyLength = null;#[ORM\ManyToOne(inversedBy: 'products')]#[ORM\JoinColumn(nullable: false)]private ?ProviderDatabase $productDatabase = null;#[ORM\ManyToOne(inversedBy: 'products')]#[ORM\JoinColumn(nullable: false)]private ?Variable $productVariable = null;#[ORM\ManyToOne(inversedBy: 'products')]#[ORM\JoinColumn(nullable: false)]private ?Portfolio $portfolio = null;#[ORM\OneToMany(mappedBy: 'product', targetEntity: Coverage::class, orphanRemoval: true)]private Collection $coverages;#[ORM\OneToMany(mappedBy: 'product', targetEntity: CatEvent::class, orphanRemoval: true)]private Collection $catEvents;public function __construct(){$this->coverages = new ArrayCollection();$this->catEvents = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getProductName(): ?string{return $this->productName;}public function setProductName(string $productName): self{$this->productName = $productName;return $this;}public function getHistoryLength(): ?int{return $this->historyLength;}public function setHistoryLength(int $historyLength): self{$this->historyLength = $historyLength;return $this;}public function getProductDatabase(): ?ProviderDatabase{return $this->productDatabase;}public function setProductDatabase(?ProviderDatabase $productDatabase): self{$this->productDatabase = $productDatabase;return $this;}public function getProductVariable(): ?Variable{return $this->productVariable;}public function setProductVariable(?Variable $productVariable): self{$this->productVariable = $productVariable;return $this;}public function getPortfolio(): ?Portfolio{return $this->portfolio;}public function setPortfolio(?Portfolio $portfolio): self{$this->portfolio = $portfolio;return $this;}/*** @return Collection<int, Coverage>*/public function getCoverages(): Collection{return $this->coverages;}public function addCoverage(Coverage $coverage): self{if (!$this->coverages->contains($coverage)) {$this->coverages->add($coverage);$coverage->setProduct($this);}return $this;}public function removeCoverage(Coverage $coverage): self{if ($this->coverages->removeElement($coverage)) {// set the owning side to null (unless already changed)if ($coverage->getProduct() === $this) {$coverage->setProduct(null);}}return $this;}/*** @return Collection<int, CatEvent>*/public function getCatEvents(): Collection{return $this->catEvents;}public function addCatEvent(CatEvent $catEvent): self{if (!$this->catEvents->contains($catEvent)) {$this->catEvents->add($catEvent);$catEvent->setProduct($this);}return $this;}public function removeCatEvent(CatEvent $catEvent): self{if ($this->catEvents->removeElement($catEvent)) {// set the owning side to null (unless already changed)if ($catEvent->getProduct() === $this) {$catEvent->setProduct(null);}}return $this;}}