public function addPeriod(Period $period) { if (!$this->periods->contains($period)) { $this->periods->add($period); } return $this; }