src/Entity/PortalLicense.php line 16
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\PortalLicenseRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PortalLicenseRepository::class)]#[ApiResource(mercure: true)]class PortalLicense{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(type: Types::TEXT)]private ?string $description = null;#[ORM\OneToMany(mappedBy: 'portalLicense', targetEntity: Portal::class)]private Collection $portals;#[ORM\ManyToMany(targetEntity: PortalFeature::class, inversedBy: 'portalLicenses')]private Collection $portalFeatures;#[ORM\Column]private ?bool $active = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $validTill = null;public function __construct(){$this->portals = new ArrayCollection();$this->portalFeatures = new ArrayCollection();$this->validTill = new \DateTime();$this->setDescription('Beschreibung');}public function getId(): ?int{return $this->id;}public function __toString(): string{return $this->name;}public function getName(): ?string{return $this->name;}public function setName(string $name): self{$this->name = $name;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(string $description): self{$this->description = $description;return $this;}/*** @return Collection<int, Portal>*/public function getPortals(): Collection{return $this->portals;}public function addPortal(Portal $portal): self{if (!$this->portals->contains($portal)) {$this->portals->add($portal);$portal->setPortalLicense($this);}return $this;}public function removePortal(Portal $portal): self{if ($this->portals->removeElement($portal)) {// set the owning side to null (unless already changed)if ($portal->getPortalLicense() === $this) {$portal->setPortalLicense(null);}}return $this;}/*** @return Collection<int, PortalFeature>*/public function getPortalFeatures(): Collection{return $this->portalFeatures;}public function addPortalFeature(PortalFeature $portalFeature): self{if (!$this->portalFeatures->contains($portalFeature)) {$this->portalFeatures->add($portalFeature);$portalFeature->addPortalLicense($this);}return $this;}public function removePortalFeature(PortalFeature $portalFeature): self{if ($this->portalFeatures->removeElement($portalFeature)) {$portalFeature->removePortalLicense($this);}return $this;}public function isActive(): ?bool{return $this->active;}public function setActive(bool $active): self{$this->active = $active;return $this;}public function getValidTill(): ?\DateTimeInterface{return $this->validTill;}public function setValidTill(\DateTimeInterface $validTill): self{$this->validTill = $validTill;return $this;}}