mirror of
https://github.com/envoyr/php-froxlor-client.git
synced 2026-04-28 12:24:08 +00:00
Initial commit
This commit is contained in:
38
src/Database.php
Normal file
38
src/Database.php
Normal 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
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user