mirror of
https://github.com/Lukas0025/YAGS.git
synced 2025-04-11 01:42:12 +01:00
22 lines
593 B
PHP
22 lines
593 B
PHP
<?php
|
|
namespace API\station;
|
|
|
|
function APIinfo($params) {
|
|
|
|
$station = new \DAL\station();
|
|
|
|
$station->find("apiKey", $params["key"]);
|
|
|
|
return ["id" => $station->id->get(), "name" => $station->name->get(), "locator" => $station->locator->get()];
|
|
}
|
|
|
|
function keys($params) {
|
|
$stations = new \wsos\database\core\table(\DAL\station::class);
|
|
|
|
$res = [];
|
|
foreach ($stations->getAll()->values as $station) {
|
|
$res[] = ["name" => $station->name->get(), "key" => $station->apiKey->get()];
|
|
}
|
|
|
|
return $res;
|
|
} |