Files
Sentri/pub/api/classes/API_office_stompjes.php
2026-06-15 16:04:21 +02:00

44 lines
1.2 KiB
PHP

<?php
namespace api\classes;
use api\classes\API;
use JetBrains\PhpStorm\NoReturn;
require_once 'API.php';
class API_office_stompjes extends API
{
#[NoReturn]
public function addStomp()
{
$query = "INSERT INTO office_stompjes (stomp_uuid, user_uuid, stomp_timestamp) VALUES (UUID(), ?, ?)";
$stmt = $this->prepareStatement($query);
$stmt->bind_param('si', $this->data['user_uuid'], time());
$this->executeStatement($stmt);
$stmt->close();
$this->apiOutput(200, ['success' => 'Stomp added.']);
}
#[NoReturn]
public function deleteStomp()
{
$query = "DELETE FROM office_stompjes WHERE stomp_uuid = ?";
$stmt = $this->prepareStatement($query);
$stmt->bind_param('s', $this->data['stomp_uuid']);
$this->executeStatement($stmt);
$stmt->close();
$this->apiOutput(200, ['success' => 'Stomp removed.']);
}
public function getStomp()
{
list($query, $types, $params) = $this->buildDynamicQuery('office_stompjes');
$items = $this->generalGetFunction($query, $types, $params, false, 'Stompjes');
return ($items);
}
}