Disable inserting of data in generate_db

This commit is contained in:
Ruben 2016-09-04 12:41:59 +01:00
parent c1c45b9172
commit f0c9be7c39
2 changed files with 4 additions and 2 deletions

View file

@ -36,6 +36,8 @@ foreach($queries as $sql){ echo "$sql;\n"; }
// updateSchema // updateSchema
$tool->updateSchema($classes); $tool->updateSchema($classes);
die();
// ADD EMOTIONS // ADD EMOTIONS
$emotions = []; $emotions = [];

View file

@ -15,13 +15,13 @@ class GameRepository extends EntityRepository
'level' => $game->getLevel(), 'level' => $game->getLevel(),
]); ]);
$position = $query->getSingleScalarResult(); $position = $query->getSingleScalarResult();
$total = $this->getGameCountForLevel($game->getLevel()); $total = $this->getCountForLevel($game->getLevel());
$highscore = $this->getHighscoreForLevel($game->getLevel()); $highscore = $this->getHighscoreForLevel($game->getLevel());
return new Position($position, $total, $game->getScore(), $highscore); return new Position($position, $total, $game->getScore(), $highscore);
} }
public function getGameCountForLevel(Level $level) { public function getCountForLevel(Level $level) {
$query = $this->_em->createQuery( $query = $this->_em->createQuery(
"SELECT COUNT(g.id) FROM ".Game::class." g WHERE g.level = :level" "SELECT COUNT(g.id) FROM ".Game::class." g WHERE g.level = :level"