mirror of
https://github.com/Lukas0025/YAGS.git
synced 2025-04-10 17:32:17 +01:00
29 lines
679 B
PHP
29 lines
679 B
PHP
<?php
|
|
namespace API\target;
|
|
|
|
function info($params) {
|
|
|
|
$target = new \DAL\target();
|
|
$target->id->set($params["id"]);
|
|
|
|
return [
|
|
"id" => $target->id->get(),
|
|
"name" => $target->name->get(),
|
|
"locator" => $target->locator->get()
|
|
];
|
|
}
|
|
|
|
function add($params) {
|
|
|
|
$target = new \DAL\target();
|
|
|
|
$target->name->set($params["name"]);
|
|
$target->type->set($params["type"]);
|
|
$target->orbit->set($params["orbit"]);
|
|
$target->locator->set(json_decode($params["locator"]));
|
|
|
|
$target->commit();
|
|
|
|
return ["id" => $target->id->get()];
|
|
}
|