mirror of
https://github.com/standardebooks/web.git
synced 2025-07-08 15:50:29 -04:00
Add auto-detected types from DB in ORM
This commit is contained in:
parent
7a11cacf6d
commit
58c0d301dd
3 changed files with 67 additions and 17 deletions
|
@ -8,7 +8,7 @@ class Db{
|
|||
/**
|
||||
* @return Array<mixed>
|
||||
*/
|
||||
public static function Query(string $query, array $args = []): array{
|
||||
public static function Query(string $query, array $args = [], string $class = 'stdClass'): array{
|
||||
if(!isset($GLOBALS['DbConnection'])){
|
||||
$GLOBALS['DbConnection'] = new DbConnection(DATABASE_DEFAULT_DATABASE, DATABASE_DEFAULT_HOST);
|
||||
}
|
||||
|
@ -17,6 +17,6 @@ class Db{
|
|||
$args = [$args];
|
||||
}
|
||||
|
||||
return $GLOBALS['DbConnection']->Query($query, $args);
|
||||
return $GLOBALS['DbConnection']->Query($query, $args, $class);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue