change from names to ids

Signed-off-by: envoyr <hello@envoyr.com>
This commit is contained in:
2024-12-08 12:17:51 +01:00
parent 63d68d8921
commit d37c0ad55b
13 changed files with 68 additions and 65 deletions

View File

@@ -5,15 +5,15 @@ namespace Envoyr\Froxlor;
class Database
{
public array $attributes;
public string $dbname;
public string $id;
public Customer $customer;
public function __construct(Customer $customer, string $dbname)
public function __construct(Customer $customer, string $id)
{
$this->customer = $customer;
$this->dbname = $dbname;
$this->id = $id;
$this->attributes = $this->customer->server->request('Mysqls.get', [
'dbname' => $this->dbname
'id' => $this->id
]);
}
@@ -22,8 +22,8 @@ class Database
return $this->customer->server->request(
'Mysqls.update',
array_merge($attributes, [
'loginname' => $this->customer->loginname,
'dbname' => $this->dbname,
'customerid' => $this->customer->id,
'id' => $this->id,
])
);
}
@@ -31,8 +31,8 @@ class Database
public function delete(): array
{
return $this->customer->server->request('Mysqls.delete', [
'loginname' => $this->customer->loginname,
'dbname' => $this->dbname
'customerid' => $this->customer->id,
'id' => $this->id
]);
}
}