From f0c9be7c39f94b3708593b7037fa7f78f5e93c94 Mon Sep 17 00:00:00 2001 From: Ruben Date: Sun, 4 Sep 2016 12:41:59 +0100 Subject: [PATCH] Disable inserting of data in generate_db --- bin/generate_db.php | 2 ++ src/Models/GameRepository.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/generate_db.php b/bin/generate_db.php index 9ed3276..5dacba3 100644 --- a/bin/generate_db.php +++ b/bin/generate_db.php @@ -36,6 +36,8 @@ foreach($queries as $sql){ echo "$sql;\n"; } // updateSchema $tool->updateSchema($classes); + +die(); // ADD EMOTIONS $emotions = []; diff --git a/src/Models/GameRepository.php b/src/Models/GameRepository.php index 6c3aecc..8c52785 100644 --- a/src/Models/GameRepository.php +++ b/src/Models/GameRepository.php @@ -15,13 +15,13 @@ class GameRepository extends EntityRepository 'level' => $game->getLevel(), ]); $position = $query->getSingleScalarResult(); - $total = $this->getGameCountForLevel($game->getLevel()); + $total = $this->getCountForLevel($game->getLevel()); $highscore = $this->getHighscoreForLevel($game->getLevel()); return new Position($position, $total, $game->getScore(), $highscore); } - public function getGameCountForLevel(Level $level) { + public function getCountForLevel(Level $level) { $query = $this->_em->createQuery( "SELECT COUNT(g.id) FROM ".Game::class." g WHERE g.level = :level"