forked from flashii/eeprom
26 lines
583 B
PHP
26 lines
583 B
PHP
<?php
|
|
namespace EEPROM\Apps;
|
|
|
|
use RuntimeException;
|
|
use Index\Data\IDbConnection;
|
|
|
|
class AppsContext {
|
|
private AppsData $appsData;
|
|
|
|
public function __construct(IDbConnection $dbConn) {
|
|
$this->appsData = new AppsData($dbConn);
|
|
}
|
|
|
|
public function getAppsData(): AppsData {
|
|
return $this->appsData;
|
|
}
|
|
|
|
public function getApp(string $appId): AppInfo {
|
|
$appInfo = $this->appsData->getApp($appId);
|
|
if($appInfo === null)
|
|
throw new RuntimeException('Not application with this ID exists.');
|
|
|
|
return $appInfo;
|
|
}
|
|
}
|