MAPG-235 basic gameflow works

This commit is contained in:
balazs committed 2021-05-12 21:01:41 +02:00
1 parent 5daed10036
commit 93f8fc3f34
10 files changed
+209 -55

No files matched your search

+9
View File
@@ -3,6 +3,7 @@
use MapGuesser\Database\Query\Select;
use MapGuesser\PersistentData\Model\Challenge;
use MapGuesser\PersistentData\Model\Map;
use MapGuesser\PersistentData\Model\Place;
use MapGuesser\PersistentData\PersistentDataManager;
class MapRepository
@@ -19,6 +20,14 @@ class MapRepository
return $this->pdm->selectFromDbById($mapId, Map::class);
}
public function getByPlace(Place $place): ?Map
{
$select = new Select(\Container::$dbConnection);
$select->where('id', '=', $place->getMapId());
return $this->pdm->selectFromDb($select, Map::class);
}
public function getByChallenge(Challenge $challenge): ?Map
{
$select = new Select(\Container::$dbConnection);