diff --git a/src/Models/GameRepository.php b/src/Models/GameRepository.php index 5700e13..6c3aecc 100644 --- a/src/Models/GameRepository.php +++ b/src/Models/GameRepository.php @@ -27,7 +27,7 @@ class GameRepository extends EntityRepository "SELECT COUNT(g.id) FROM ".Game::class." g WHERE g.level = :level" ) ->setParameters([ - 'level' => $level(), + 'level' => $level, ]); return $query->getSingleScalarResult(); } diff --git a/src/Models/Hit.php b/src/Models/Hit.php index cc91670..94d0f7d 100644 --- a/src/Models/Hit.php +++ b/src/Models/Hit.php @@ -633,7 +633,7 @@ class Hit /** * Gets the value of game. - * + * @JMS\Exclude * @return mixed */ public function getGame() diff --git a/src/Models/Level.php b/src/Models/Level.php index 9e15f8c..e34e163 100644 --- a/src/Models/Level.php +++ b/src/Models/Level.php @@ -33,10 +33,12 @@ class Level /** * @ORM\OneToMany(targetEntity="Target", mappedBy="level", cascade={"persist"}) + * @OrderBy({"position" = "ASC"}) */ private $targets; /** + * @JMS\Exclude * @ORM\OneToMany(targetEntity="Game", mappedBy="level", fetch="EXTRA_LAZY") */ private $games; diff --git a/src/Models/Target.php b/src/Models/Target.php index 9cb2320..4649515 100644 --- a/src/Models/Target.php +++ b/src/Models/Target.php @@ -58,6 +58,7 @@ class Target private $score; /** + * @JMS\Exclude * @ORM\OneToMany(targetEntity="Hit", mappedBy="target", fetch="EXTRA_LAZY") */ private $hits;