adapt Container usage to new soko-web

This commit is contained in:
bence committed 2023-04-20 00:39:10 +02:00
1 parent ee4a9f2ce3
commit e52300b9e5
23 files changed
+248 -397

No files matched your search

+2 -10
View File
@@ -4,20 +4,12 @@ use SokoWeb\Database\Query\Select;
use MapGuesser\PersistentData\Model\Challenge;
use MapGuesser\PersistentData\Model\Map;
use MapGuesser\PersistentData\Model\Place;
use SokoWeb\PersistentData\PersistentDataManager;
class MapRepository
{
private PersistentDataManager $pdm;
public function __construct()
{
$this->pdm = new PersistentDataManager();
}
public function getById(int $mapId): ?Map
{
return $this->pdm->selectFromDbById($mapId, Map::class);
return \Container::$persistentDataManager->selectFromDbById($mapId, Map::class);
}
public function getByPlace(Place $place): ?Map
@@ -33,6 +25,6 @@ class MapRepository
$select->where('challenge_id', '=', $challenge->getId());
$select->limit(1);
return $this->pdm->selectFromDb($select, Map::class);
return \Container::$persistentDataManager->selectFromDb($select, Map::class);
}
}