protected function persistAbilityProgress(User $user, Ability $ability, $status) { $progress = new AbilityProgress(); $progress->setUser($user); $progress->setAbility($ability); $progress->setStatus($status); $this->om->persist($progress); return $progress; }
private function getAbilityProgress(Ability $ability, User $user) { $progress = $this->abilityProgressRepo->findOneBy(['ability' => $ability, 'user' => $user]); if (!$progress) { $progress = new AbilityProgress(); $progress->setAbility($ability); $progress->setUser($user); $this->om->persist($progress); } return $progress; }