Пример #1
0
 public function findOrCreate($playerName)
 {
     try {
         return BogglePlayerServiceUtil::findByName($playerName);
     } catch (NoSuchBogglePlayerException $e) {
         $player = $this->createBogglePlayer();
         $player->setName($playerName);
         return $this->updateBogglePlayer($player);
     }
 }