The PHP app runs on Cafe24 shared web hosting -- calling it 'cloud' was misleading. Renames the directory, the edge client module, and every doc/script/identifier that used the term. - cloud/ -> server/ (incl. server/deploy/build_cafe24_package.sh paths) - edge/cloudclient.py -> edge/serverclient.py, CloudClient -> ServerClient - cloud/docs/cloud-deploy.md -> server/docs/server-deploy.md - CLOUD_* env/config keys -> SERVER_* - tests renamed to match Tests: PHP 109 pass (4 skipped), pytest 167 pass. dist/ regenerated.
23 lines
581 B
PHP
23 lines
581 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
namespace App\Repository\Pdo;
|
|
|
|
use App\Repository\ThresholdRepository;
|
|
use PDO;
|
|
|
|
final class PdoThresholdRepository implements ThresholdRepository
|
|
{
|
|
public function __construct(private PDO $pdo) {}
|
|
|
|
public function forDevice(string $deviceId): array
|
|
{
|
|
$st = $this->pdo->prepare('SELECT `key`, `value` FROM move_thresholds WHERE device_id = ?');
|
|
$st->execute([$deviceId]);
|
|
|
|
$out = [];
|
|
foreach ($st->fetchAll() as $row) {
|
|
$out[$row['key']] = $row['value'];
|
|
}
|
|
return $out;
|
|
}
|
|
}
|