src/Entity/Landingpage.php line 15
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\LandingpageRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\UX\Turbo\Attribute\Broadcast;#[ORM\Entity(repositoryClass: LandingpageRepository::class)]#[ApiResource]#[Broadcast]class Landingpage{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\ManyToOne(inversedBy: 'landingpages')]private ?Portal $portal = null;#[ORM\OneToMany(mappedBy: 'landingpage', targetEntity: LandingpageElement::class, cascade: ['persist'])]private Collection $landingpageElements;public function __construct(){$this->landingpageElements = new ArrayCollection();$this->addLandingpageElement(new LandingpageElement());}public function getId(): ?int{return $this->id;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getPortal(): ?Portal{return $this->portal;}public function setPortal(?Portal $portal): self{$this->portal = $portal;return $this;}/*** @return Collection<int, LandingpageElement>*/public function getLandingpageElements(): Collection{return $this->landingpageElements;}public function addLandingpageElement(LandingpageElement $landingpageElement): self{if (!$this->landingpageElements->contains($landingpageElement)) {$this->landingpageElements->add($landingpageElement);$landingpageElement->setLandingpage($this);}return $this;}public function removeLandingpageElement(LandingpageElement $landingpageElement): self{if ($this->landingpageElements->removeElement($landingpageElement)) {// set the owning side to null (unless already changed)if ($landingpageElement->getLandingpage() === $this) {$landingpageElement->setLandingpage(null);}}return $this;}}