<?php
namespace App\Entity;
use App\Repository\GroepRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: GroepRepository::class)]
class Groep
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $naam = null;
#[ORM\OneToMany(mappedBy: 'groep', targetEntity: Reminder::class)]
private Collection $reminders;
#[ORM\ManyToMany(targetEntity: user::class, inversedBy: 'groepen')]
private Collection $users;
public function __construct()
{
$this->reminders = new ArrayCollection();
$this->users = new ArrayCollection();
}
public function __toString()
{
return $this->getNaam();
}
public function getId(): ?int
{
return $this->id;
}
public function getNaam(): ?string
{
return $this->naam;
}
public function setNaam(string $naam): static
{
$this->naam = $naam;
return $this;
}
/**
* @return Collection<int, Reminder>
*/
public function getReminders(): Collection
{
return $this->reminders;
}
public function addReminder(Reminder $reminder): static
{
if (!$this->reminders->contains($reminder)) {
$this->reminders->add($reminder);
$reminder->setGroep($this);
}
return $this;
}
public function removeReminder(Reminder $reminder): static
{
if ($this->reminders->removeElement($reminder)) {
// set the owning side to null (unless already changed)
if ($reminder->getGroep() === $this) {
$reminder->setGroep(null);
}
}
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);
}
return $this;
}
public function removeUser(user $user): static
{
$this->users->removeElement($user);
return $this;
}
public function getAutocompleteUser(){
return null;
}
public function setAutocompleteUser($value){
return $this;
}
}