18 lines
406 B
PHP
18 lines
406 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();
|
|
}
|
|
}
|
|
} |