ringfinger/data/classes/core/MySqlTable.php
2020-08-17 23:46:58 +02:00

18 lines
457 B
PHP

<?php
class MySqlTable extends Table
{
public function __construct(string $tableName, $id = null, DatabaseInterface &$database = null)
{
self::EnsureConnection($database);
parent::__construct($tableName, $id, $database);
}
public static function EnsureConnection(?DatabaseInterface & $database): void
{
if (!($database instanceof MySqlDatabase)) {
$database = new MySqlDatabase();
}
}
}