adapt Container usage to new soko-web
This commit is contained in:
23 files changed
+248
-397
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user