<?phpnamespace App\Entity;use App\Repository\BookingUserGroupRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: BookingUserGroupRepository::class)]class BookingUserGroup{ use IdentifiableTrait; #[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'bookingUserGroups')] private Collection $user; #[ORM\Column(length: 50)] private ?string $name = null; #[ORM\Column(length: 50)] private ?string $slug = null; #[ORM\ManyToMany(targetEntity: BookingEvent::class, mappedBy: 'groups')] private Collection $bookingEvents; public function __construct() { $this->user = new ArrayCollection(); $this->bookingEvents = new ArrayCollection(); } public function getId(): ?int { return $this->id; } /** * @return Collection<int, User> */ public function getUser(): Collection { return $this->user; } public function addUser(User $user): static { if (!$this->user->contains($user)) { $this->user->add($user); } return $this; } public function removeUser(User $user): static { $this->user->removeElement($user); return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): static { $this->slug = $slug; return $this; } /** * @return Collection<int, BookingEvent> */ public function getBookingEvents(): Collection { return $this->bookingEvents; } public function addBookingEvent(BookingEvent $bookingEvent): static { if (!$this->bookingEvents->contains($bookingEvent)) { $this->bookingEvents->add($bookingEvent); $bookingEvent->addGroup($this); } return $this; } public function removeBookingEvent(BookingEvent $bookingEvent): static { if ($this->bookingEvents->removeElement($bookingEvent)) { $bookingEvent->removeGroup($this); } return $this; }}