Skip to content

Commit

Permalink
thusfar
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmagicii committed Mar 28, 2024
1 parent 631e668 commit c8e9f48
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/Nether/Database/Connection.php
Expand Up @@ -10,29 +10,39 @@
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

class Connection {
class Connection
extends Common\Prototype
implements Common\Interfaces\ToArray {

#[Common\Meta\PropertyListable]
public ?string
$Name;

#[Common\Meta\PropertyListable]
public string
$Type;

#[Common\Meta\PropertyListable]
public string
$Hostname;

#[Common\Meta\PropertyListable]
public string
$Database;

#[Common\Meta\PropertyListable]
public string
$Username;

#[Common\Meta\PropertyListable]
public string
$Password;

#[Common\Meta\PropertyListable]
public string
$Charset;

#[Common\Meta\PropertyListable]
public bool
$Auto;

Expand Down Expand Up @@ -100,6 +110,18 @@ public function
];
}

public function
ToArray():
array {

$Props = array_map(
(fn(Common\Prototype\PropertyInfo $P)=> $this->{$P->Name}),
static::FetchPropertiesWithAttribute(Common\Meta\PropertyListable::class)
);

return $Props;
}

////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -212,7 +234,6 @@ public function
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////


public function
Query(string $Format, array|object $Argv=[]):
Result {
Expand Down

0 comments on commit c8e9f48

Please sign in to comment.