<?phpnamespace App\Entity;use App\Repository\OrganizationRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: OrganizationRepository::class)]class Organization{ const TYPE_UNIVERSITY = 1; const TYPE_OTHER = 2; const DEFAULT_TYPE = self::TYPE_UNIVERSITY; const TYPE_ARRAY = [ 'organization.type.university' => self::TYPE_UNIVERSITY, 'organization.type.other' => self::TYPE_OTHER, ]; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(length: 255, nullable: true)] private ?string $domain = null; #[ORM\Column] private ?bool $edugain = null; #[ORM\Column] private ?bool $paidAccess = null; #[ORM\OneToMany(mappedBy: 'organization', targetEntity: User::class)] private Collection $users; #[ORM\Column] private ?int $type = null; #[ORM\Column(length: 255, nullable: true)] private ?string $address = null; public function __construct() { $this->users = new ArrayCollection(); } public function __toString() { return $this->name; } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getDomain(): ?string { return $this->domain; } public function setDomain(?string $domain): static { $this->domain = $domain; return $this; } public function isEdugain(): ?bool { return $this->edugain; } public function setEdugain(bool $edugain): static { $this->edugain = $edugain; return $this; } public function isPaidAccess(): ?bool { return $this->paidAccess; } public function setPaidAccess(bool $paidAccess): static { $this->paidAccess = $paidAccess; return $this; } /** * @return Collection<int, User> */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): static { if (!$this->users->contains($user)) { $this->users->add($user); $user->setOrganization($this); } return $this; } public function removeUser(User $user): static { if ($this->users->removeElement($user)) { // set the owning side to null (unless already changed) if ($user->getOrganization() === $this) { $user->setOrganization(null); } } return $this; } public function getType(): ?int { return $this->type; } public function setType(int $type): static { $this->type = $type; return $this; } public function getAddress(): ?string { return $this->address; } public function setAddress(?string $address): static { $this->address = $address; return $this; }}