<?phpnamespace App\Entity;use App\Entity\Abstract\Entity;use App\Repository\InstitutionRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Uid\Uuid;#[ORM\Entity(repositoryClass: InstitutionRepository::class)]class Institution extends Entity{ #[ORM\Id] #[ORM\Column(type: 'uuid', unique: true)] #[ORM\GeneratedValue(strategy: 'CUSTOM')] #[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')] private ?Uuid $id = null; #[ORM\Column(length: 100)] #[Gedmo\Versioned] private ?string $name = null; #[ORM\ManyToMany(targetEntity: Enterprise::class, inversedBy: 'participations')] private Collection $participation; #[ORM\OneToOne(cascade: ['persist', 'remove'])] #[Gedmo\Versioned] private ?Address $address = null; #[ORM\OneToMany(mappedBy: 'institution', targetEntity: Discount::class, cascade: ['persist', 'remove'])] private Collection $discounts; #[ORM\Column(length: 50, nullable: true)] #[Gedmo\Versioned] private ?string $customerNumber = null; #[ORM\ManyToOne(inversedBy: 'institutions')] protected ?User $createdBy = null; public function __construct() { $this->participation = new ArrayCollection(); $this->discounts = new ArrayCollection(); } public function getId(): ?Uuid { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } /** * @return Collection<int, Enterprise> */ public function getParticipation(): Collection { return $this->participation; } public function addParticipation(Enterprise $participation): self { if (!$this->participation->contains($participation)) { $this->participation->add($participation); } return $this; } public function removeParticipation(Enterprise $participation): self { $this->participation->removeElement($participation); return $this; } public function getAddress(): ?Address { return $this->address; } public function setAddress(?Address $address): self { $this->address = $address; return $this; } /** * @return Collection<int, Discount> */ public function getDiscounts(): Collection { return $this->discounts; } public function addDiscount(Discount $discount): self { if (!$this->discounts->contains($discount)) { $this->discounts->add($discount); $discount->setInstitution($this); } return $this; } public function removeDiscount(Discount $discount): self { if ($this->discounts->removeElement($discount)) { // set the owning side to null (unless already changed) if ($discount->getInstitution() === $this) { $discount->setInstitution(null); } } return $this; } public function getCustomerNumber(): ?string { return $this->customerNumber; } public function setCustomerNumber(?string $customerNumber): self { $this->customerNumber = $customerNumber; return $this; }}