/** * @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; }
/** * @param object $obj * @param bool|true $flush */ private function save($obj, $flush = true) { $this->playerRepository->getManager()->persist($obj); if ($flush) { $this->playerRepository->getManager()->flush(); } }
/** * @param array $order * @return array */ public function findPlayers(array $order = array()) { return $this->playerRepository->findBy([], $order); }