Initial commit

This commit is contained in:
2022-01-18 17:14:29 +01:00
commit 320a153918
18 changed files with 622 additions and 0 deletions

38
src/Database.php Normal file
View File

@@ -0,0 +1,38 @@
<?php
namespace Envoyr\Froxlor;
class Database
{
public array $attributes;
public string $dbname;
public Customer $customer;
public function __construct(Customer $customer, string $dbname)
{
$this->customer = $customer;
$this->dbname = $dbname;
$this->attributes = $this->customer->server->request('Mysqls.get', [
'dbname' => $this->dbname
]);
}
public function update(array $attributes): array
{
return $this->customer->server->request(
'Mysqls.update',
array_merge($attributes, [
'loginname' => $this->customer->loginname,
'dbname' => $this->dbname,
])
);
}
public function delete(): array
{
return $this->customer->server->request('Mysqls.delete', [
'loginname' => $this->customer->loginname,
'dbname' => $this->dbname
]);
}
}