src/Entity/Corporation.php line 16
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\CorporationRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\UX\Turbo\Attribute\Broadcast;#[ORM\Entity(repositoryClass: CorporationRepository::class)]#[Broadcast]#[ApiResource]class Corporation{#[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\Embedded(class: Adress::class)]private Adress $adress;#[ORM\Embedded(class: Adress::class)]private Adress $billingAdress;#[ORM\OneToMany(mappedBy: 'corporation', targetEntity: CorporationContact::class)]private Collection $corporationContacts;#[ORM\OneToMany(mappedBy: 'corporation', targetEntity: Attendee::class)]private Collection $attendees;#[ORM\OneToMany(mappedBy: 'corporation', targetEntity: Portal::class)]private Collection $portals;#[ORM\OneToMany(mappedBy: 'corporation', targetEntity: Department::class)]private Collection $departments;#[ORM\Column(length: 255)]private ?string $CorporationType = null;#[ORM\OneToMany(mappedBy: 'corporation', targetEntity: PortalAdministrator::class)]private Collection $portalAdministrators;#[ORM\OneToMany(mappedBy: 'customer', targetEntity: Promo::class)]private Collection $promos;#[ORM\OneToMany(mappedBy: 'corporation', targetEntity: CorporationDiscount::class)]private Collection $corporationDiscounts;public function __construct(){$this->adress = new Adress();$this->billingAdress = new Adress();$this->corporationContacts = new ArrayCollection();$this->attendees = new ArrayCollection();$this->portals = new ArrayCollection();$this->departments = new ArrayCollection();$this->portalAdministrators = new ArrayCollection();$this->promos = new ArrayCollection();$this->corporationDiscounts = new ArrayCollection();}public function __toString(): string{return $this->name;}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 getDescription(): ?string{return $this->description;}public function setDescription(string $description): self{$this->description = $description;return $this;}/*** @return Adress*/public function getAdress(): Adress{return $this->adress;}/*** @param Adress $adress* @return Corporation*/public function setAdress(Adress $adress): Corporation{$this->adress = $adress;return $this;}/*** @return Adress*/public function getBillingAdress(): Adress{return $this->billingAdress;}/*** @param Adress $billingAdress* @return Corporation*/public function setBillingAdress(Adress $billingAdress): Corporation{$this->billingAdress = $billingAdress;return $this;}/*** @return Collection<int, CorporationContact>*/public function getCorporationContacts(): Collection{return $this->corporationContacts;}public function addCorporationContact(CorporationContact $corporationContact): self{if (!$this->corporationContacts->contains($corporationContact)) {$this->corporationContacts->add($corporationContact);$corporationContact->setCorporation($this);}return $this;}public function removeCorporationContact(CorporationContact $corporationContact): self{if ($this->corporationContacts->removeElement($corporationContact)) {// set the owning side to null (unless already changed)if ($corporationContact->getCorporation() === $this) {$corporationContact->setCorporation(null);}}return $this;}/*** @return Collection<int, Attendee>*/public function getAttendees(): Collection{return $this->attendees;}public function addAttendee(Attendee $attendee): self{if (!$this->attendees->contains($attendee)) {$this->attendees->add($attendee);$attendee->setCorporation($this);}return $this;}public function removeAttendee(Attendee $attendee): self{if ($this->attendees->removeElement($attendee)) {// set the owning side to null (unless already changed)if ($attendee->getCorporation() === $this) {$attendee->setCorporation(null);}}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->setCorporation($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->getCorporation() === $this) {$portal->setCorporation(null);}}return $this;}/*** @return Collection<int, Department>*/public function getDepartments(): Collection{return $this->departments;}public function addDepartment(Department $department): self{if (!$this->departments->contains($department)) {$this->departments->add($department);$department->setCorporation($this);}return $this;}public function removeDepartment(Department $department): self{if ($this->departments->removeElement($department)) {// set the owning side to null (unless already changed)if ($department->getCorporation() === $this) {$department->setCorporation(null);}}return $this;}public function getCorporationType(): ?string{return $this->CorporationType;}public function setCorporationType(string $CorporationType): self{$this->CorporationType = $CorporationType;return $this;}/*** @return Collection<int, PortalAdministrator>*/public function getPortalAdministrators(): Collection{return $this->portalAdministrators;}public function addPortalAdministrator(PortalAdministrator $portalAdministrator): self{if (!$this->portalAdministrators->contains($portalAdministrator)) {$this->portalAdministrators->add($portalAdministrator);$portalAdministrator->setCorporation($this);}return $this;}public function removePortalAdministrator(PortalAdministrator $portalAdministrator): self{if ($this->portalAdministrators->removeElement($portalAdministrator)) {// set the owning side to null (unless already changed)if ($portalAdministrator->getCorporation() === $this) {$portalAdministrator->setCorporation(null);}}return $this;}/*** @return Collection<int, Promo>*/public function getPromos(): Collection{return $this->promos;}public function addPromo(Promo $promo): self{if (!$this->promos->contains($promo)) {$this->promos->add($promo);$promo->setCustomer($this);}return $this;}public function removePromo(Promo $promo): self{if ($this->promos->removeElement($promo)) {// set the owning side to null (unless already changed)if ($promo->getCustomer() === $this) {$promo->setCustomer(null);}}return $this;}/*** @return Collection<int, CorporationDiscount>*/public function getCorporationDiscounts(): Collection{return $this->corporationDiscounts;}public function addCorporationDiscount(CorporationDiscount $corporationDiscount): self{if (!$this->corporationDiscounts->contains($corporationDiscount)) {$this->corporationDiscounts->add($corporationDiscount);$corporationDiscount->setCorporation($this);}return $this;}public function removeCorporationDiscount(CorporationDiscount $corporationDiscount): self{if ($this->corporationDiscounts->removeElement($corporationDiscount)) {// set the owning side to null (unless already changed)if ($corporationDiscount->getCorporation() === $this) {$corporationDiscount->setCorporation(null);}}return $this;}}