/**
  * @param int $playerid
  *
  * @return Player
  *
  * @throws TransformationFailedException
  */
 public function reverseTransform($playerid)
 {
     if (!$playerid) {
         return null;
     }
     $player = $this->playerRepository->find($playerid);
     if (!$player) {
         throw new TransformationFailedException('Player with id "%s" does not exists', $playerid);
     }
     return $player;
 }
Пример #2
0
 /**
  * @param object $obj
  * @param bool|true $flush
  */
 private function save($obj, $flush = true)
 {
     $this->playerRepository->getManager()->persist($obj);
     if ($flush) {
         $this->playerRepository->getManager()->flush();
     }
 }
Пример #3
0
 /**
  * @param array $order
  * @return array
  */
 public function findPlayers(array $order = array())
 {
     return $this->playerRepository->findBy([], $order);
 }