src/Entity/Portfolio.php line 13
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\PortfolioRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PortfolioRepository::class)]#[ApiResource]class Portfolio{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $portfolioName = null;#[ORM\ManyToOne(inversedBy: 'portfolios')]#[ORM\JoinColumn(nullable: false)]private ?ThirdParty $thirdParty = null;#[ORM\OneToMany(mappedBy: 'portfolio', targetEntity: Product::class, orphanRemoval: true)]private Collection $products;public function __construct(){$this->products = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getPortfolioName(): ?string{return $this->portfolioName;}public function setPortfolioName(string $portfolioName): self{$this->portfolioName = $portfolioName;return $this;}public function getThirdParty(): ?ThirdParty{return $this->thirdParty;}public function setThirdParty(?ThirdParty $thirdParty): self{$this->thirdParty = $thirdParty;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->add($product);$product->setPortfolio($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->getPortfolio() === $this) {$product->setPortfolio(null);}}return $this;}}