public function addContributionTo(Repository $repository, $score) { $contribution = new Contribution($this, $repository, $score); $repository->getContributions()->add($contribution); $this->contributions->add($contribution); }
public function addMembership(PlaysInTeam $playsInTeam) { if (!$this->memberships->contains($playsInTeam)) { $this->memberships->add($playsInTeam); } }