2
0
Fork 0
forked from flashii/eeprom
eeprom-nabucco/src/Apps/AppsData.php

25 lines
746 B
PHP

<?php
namespace EEPROM\Apps;
use Index\Data\DbStatementCache;
use Index\Data\IDbConnection;
// this system is to be deprecated and replaced by pools system
class AppsData {
private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn);
}
public function getApp(string $appId): ?AppInfo {
$stmt = $this->cache->get('SELECT app_id, app_name, UNIX_TIMESTAMP(app_created), app_size_limit, app_allow_size_multiplier, app_expiry FROM prm_applications WHERE app_id = ?');
$stmt->addParameter(1, $appId);
$stmt->execute();
$result = $stmt->getResult();
return $result->next() ? new AppInfo($result) : null;
}
}