src/Entity/Portal.php line 15

  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\PortalRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\UX\Turbo\Attribute\Broadcast;
  9. #[ORM\Entity(repositoryClassPortalRepository::class)]
  10. #[ApiResource]
  11. #[Broadcast]
  12. class Portal
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $name null;
  20.     #[ORM\Column(length255)]
  21.     private ?string $domain null;
  22.     #[ORM\ManyToOne(inversedBy'portals')]
  23.     private ?Corporation $corporation null;
  24.     #[ORM\OneToMany(mappedBy'portal'targetEntityCatalog::class)]
  25.     private Collection $catalogs;
  26.     #[ORM\OneToMany(mappedBy'portal'targetEntityAttendee::class)]
  27.     private Collection $attendees;
  28.     #[ORM\ManyToOne(inversedBy'portals')]
  29.     private ?PortalLicense $portalLicense null;
  30.     #[ORM\Column(length255)]
  31.     private ?string $portalType null;
  32.     #[ORM\OneToMany(mappedBy'portal'targetEntityPortalAdministrator::class)]
  33.     private Collection $portalAdministrators;
  34.     #[ORM\OneToMany(mappedBy'portal'targetEntityLandingpage::class)]
  35.     private Collection $landingpages;
  36.     #[ORM\Column(length255)]
  37.     private ?string $logo null;
  38.     #[ORM\Column(length255)]
  39.     private ?string $primaryColor null;
  40.     #[ORM\Column(length255)]
  41.     private ?string $secondaryColor null;
  42.     public function getPortalLicense(): ?PortalLicense
  43.     {
  44.         return $this->portalLicense;
  45.     }
  46.     public function setPortalLicense(?PortalLicense $portalLicense): self
  47.     {
  48.         $this->portalLicense $portalLicense;
  49.         return $this;
  50.     }
  51.     public function __construct()
  52.     {
  53.         $this->catalogs = new ArrayCollection();
  54.         $this->attendees = new ArrayCollection();
  55.         $this->portalAdministrators = new ArrayCollection();
  56.         $this->landingpages = new ArrayCollection();
  57.     }
  58.     public function __toString(): string
  59.     {
  60.         return $this->name;
  61.     }
  62.     public function getId(): ?int
  63.     {
  64.         return $this->id;
  65.     }
  66.     public function getName(): ?string
  67.     {
  68.         return $this->name;
  69.     }
  70.     public function setName(string $name): self
  71.     {
  72.         $this->name $name;
  73.         return $this;
  74.     }
  75.     public function getDomain(): ?string
  76.     {
  77.         return $this->domain;
  78.     }
  79.     public function setDomain(string $domain): self
  80.     {
  81.         $this->domain $domain;
  82.         return $this;
  83.     }
  84.     public function getCorporation(): ?corporation
  85.     {
  86.         return $this->corporation;
  87.     }
  88.     public function setCorporation(?corporation $corporation): self
  89.     {
  90.         $this->corporation $corporation;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Collection<int, Catalog>
  95.      */
  96.     public function getCatalogs(): Collection
  97.     {
  98.         return $this->catalogs;
  99.     }
  100.     public function addCatalog(Catalog $catalog): self
  101.     {
  102.         if (!$this->catalogs->contains($catalog)) {
  103.             $this->catalogs->add($catalog);
  104.             $catalog->setPortal($this);
  105.         }
  106.         return $this;
  107.     }
  108.     public function removeCatalog(Catalog $catalog): self
  109.     {
  110.         if ($this->catalogs->removeElement($catalog)) {
  111.             // set the owning side to null (unless already changed)
  112.             if ($catalog->getPortal() === $this) {
  113.                 $catalog->setPortal(null);
  114.             }
  115.         }
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return Collection<int, Attendee>
  120.      */
  121.     public function getAttendees(): Collection
  122.     {
  123.         return $this->attendees;
  124.     }
  125.     public function addAttendee(Attendee $attendee): self
  126.     {
  127.         if (!$this->attendees->contains($attendee)) {
  128.             $this->attendees->add($attendee);
  129.             $attendee->setPortal($this);
  130.         }
  131.         return $this;
  132.     }
  133.     public function removeAttendee(Attendee $attendee): self
  134.     {
  135.         if ($this->attendees->removeElement($attendee)) {
  136.             // set the owning side to null (unless already changed)
  137.             if ($attendee->getPortal() === $this) {
  138.                 $attendee->setPortal(null);
  139.             }
  140.         }
  141.         return $this;
  142.     }
  143.     public function getPortalType(): ?string
  144.     {
  145.         return $this->portalType;
  146.     }
  147.     public function setPortalType(string $portalType): self
  148.     {
  149.         $this->portalType $portalType;
  150.         return $this;
  151.     }
  152.     /**
  153.      * @return Collection<int, PortalAdministrator>
  154.      */
  155.     public function getPortalAdministrators(): Collection
  156.     {
  157.         return $this->portalAdministrators;
  158.     }
  159.     public function addPortalAdministrator(PortalAdministrator $portalAdministrator): self
  160.     {
  161.         if (!$this->portalAdministrators->contains($portalAdministrator)) {
  162.             $this->portalAdministrators->add($portalAdministrator);
  163.             $portalAdministrator->setPortal($this);
  164.         }
  165.         return $this;
  166.     }
  167.     public function removePortalAdministrator(PortalAdministrator $portalAdministrator): self
  168.     {
  169.         if ($this->portalAdministrators->removeElement($portalAdministrator)) {
  170.             // set the owning side to null (unless already changed)
  171.             if ($portalAdministrator->getPortal() === $this) {
  172.                 $portalAdministrator->setPortal(null);
  173.             }
  174.         }
  175.         return $this;
  176.     }
  177.     /**
  178.      * @return Collection<int, Landingpage>
  179.      */
  180.     public function getLandingpages(): Collection
  181.     {
  182.         return $this->landingpages;
  183.     }
  184.     public function addLandingpage(Landingpage $landingpage): self
  185.     {
  186.         if (!$this->landingpages->contains($landingpage)) {
  187.             $this->landingpages->add($landingpage);
  188.             $landingpage->setPortal($this);
  189.         }
  190.         return $this;
  191.     }
  192.     public function removeLandingpage(Landingpage $landingpage): self
  193.     {
  194.         if ($this->landingpages->removeElement($landingpage)) {
  195.             // set the owning side to null (unless already changed)
  196.             if ($landingpage->getPortal() === $this) {
  197.                 $landingpage->setPortal(null);
  198.             }
  199.         }
  200.         return $this;
  201.     }
  202.     public function getLogo(): ?string
  203.     {
  204.         return $this->logo;
  205.     }
  206.     public function setLogo(?string $logo): self
  207.     {
  208.         $this->logo $logo;
  209.         return $this;
  210.     }
  211.     public function getPrimaryColor(): ?string
  212.     {
  213.         return $this->primaryColor;
  214.     }
  215.     public function setPrimaryColor(string $primaryColor): self
  216.     {
  217.         $this->primaryColor $primaryColor;
  218.         return $this;
  219.     }
  220.     public function getSecondaryColor(): ?string
  221.     {
  222.         return $this->secondaryColor;
  223.     }
  224.     public function setSecondaryColor(string $secondaryColor): self
  225.     {
  226.         $this->secondaryColor $secondaryColor;
  227.         return $this;
  228.     }
  229. }