fix: select() with no table model defined throws error (#12)

This commit is contained in:
Victor Westerlund 2023-10-31 15:38:33 +01:00 committed by GitHub
parent 84efec8938
commit 8ff61b7275
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@
// Interface for MySQL_Driver with abstractions for data manipulation
class MySQL extends DatabaseDriver {
private string $table;
private array $model;
private ?array $model = null;
private ?string $order_by = null;
private ?string $filter_sql = null;
@ -152,8 +152,6 @@
// Interpolate components into an SQL SELECT statmenet and execute
$sql = "SELECT {$columns_sql} FROM {$this->table}{$filter_sql}{$order_by_sql}{$limit_sql}";
$test = $this->model;
// No columns were specified, return true if query matched rows
if (!$columns) {
return $this->exec_bool($sql, $this->filter_values);