public function addSubject(Subject $subject) { if (!$this->subjects->contains($subject)) { $this->subjects->add($subject); } return $this; }