コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }