If you implicitly save the number of deaths in the Game object, just add a function getDeaths()to the entity. You should probably have it there, and not just keep a public variable that can be changed anyway.
The repository method will be needed if you need to directly request the number of deaths from the database, in which case you can simply pass this directly to the template.
, ,
return array('game' => $game);
:
{{ game.numDeaths }}
, :
return array('game' => $game, 'numDeaths' => $numDeaths);
:
{{ numDeaths }}
, .