src/Entity/Calendar.php line 12
<?phpnamespace App\Entity;use App\Repository\CalendarRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;#[ORM\Entity(repositoryClass: CalendarRepository::class)]class Calendar{use TimestampableEntity;#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\OneToMany(mappedBy: 'calendar', targetEntity: Period::class)]private Collection $periods;public function __construct(){$this->periods = new ArrayCollection();}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;}/*** @return Collection<int, Period>*/public function getPeriods(): Collection{return $this->periods;}public function addPeriod(Period $period): self{if (!$this->periods->contains($period)) {$this->periods->add($period);$period->setCalendar($this);}return $this;}public function removePeriod(Period $period): self{if ($this->periods->removeElement($period)) {// set the owning side to null (unless already changed)if ($period->getCalendar() === $this) {$period->setCalendar(null);}}return $this;}}