src/Entity/PortalFeature.php line 16

  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\PortalFeatureRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassPortalFeatureRepository::class)]
  10. #[ApiResource(
  11.     mercuretrue
  12. )]
  13. class PortalFeature
  14. {
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     private ?int $id null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $name null;
  21.     #[ORM\Column(typeTypes::TEXT)]
  22.     private ?string $description null;
  23.     #[ORM\ManyToMany(targetEntityPortalLicense::class, mappedBy'portalFeatures')]
  24.     private Collection $portalLicenses;
  25.     public function __construct()
  26.     {
  27.         $this->portalLicenses = new ArrayCollection();
  28.     }
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function __toString(): string
  34.     {
  35.         return $this->name;
  36.     }
  37.     public function getName(): ?string
  38.     {
  39.         return $this->name;
  40.     }
  41.     public function setName(string $name): self
  42.     {
  43.         $this->name $name;
  44.         return $this;
  45.     }
  46.     public function getDescription(): ?string
  47.     {
  48.         return $this->description;
  49.     }
  50.     public function setDescription(string $description): self
  51.     {
  52.         $this->description $description;
  53.         return $this;
  54.     }
  55.     /**
  56.      * @return Collection<int, PortalLicense>
  57.      */
  58.     public function getPortalLicenses(): Collection
  59.     {
  60.         return $this->portalLicenses;
  61.     }
  62.     public function addPortalLicense(PortalLicense $portalLicense): self
  63.     {
  64.         if (!$this->portalLicenses->contains($portalLicense)) {
  65.             $this->portalLicenses->add($portalLicense);
  66.         }
  67.         return $this;
  68.     }
  69.     public function removePortalLicense(PortalLicense $portalLicense): self
  70.     {
  71.         $this->portalLicenses->removeElement($portalLicense);
  72.         return $this;
  73.     }
  74. }