Skip to content

Commit 3d766a3

Browse files
committed
Update ezFunctions.php
fixes issue #202
1 parent f50139f commit 3d766a3

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/ezFunctions.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use ezsql\ezQuery;
44
use ezsql\ezSchema;
55
use ezsql\Database;
6+
use ezsql\ezQueryInterface;
67
use ezsql\DatabaseInterface;
78
use ezsql\Database\ez_pdo;
89

@@ -283,7 +284,7 @@ function setInstance($ezSQL = '')
283284
global $ezInstance;
284285
$status = false;
285286

286-
if ($ezSQL instanceof DatabaseInterface) {
287+
if ($ezSQL instanceof ezQueryInterface) {
287288
$ezInstance = $ezSQL;
288289
$status = true;
289290
}
@@ -295,7 +296,7 @@ function getInstance()
295296
{
296297
global $ezInstance;
297298

298-
return ($ezInstance instanceof DatabaseInterface) ? $ezInstance : null;
299+
return ($ezInstance instanceof ezQueryInterface) ? $ezInstance : null;
299300
}
300301

301302
function clearInstance()
@@ -325,7 +326,7 @@ function select_into($table, $columns = '*', $old = null, ...$args)
325326
: false;
326327
}
327328

328-
function insert_select($totable = '', $columns = '*', $fromTable, $from = '*', ...$args)
329+
function insert_select($totable = '', $columns = '*', $fromTable = null, $from = '*', ...$args)
329330
{
330331
$ezQuery = \getInstance();
331332
return ($ezQuery instanceof DatabaseInterface)
@@ -461,15 +462,15 @@ function limit($numberOf, $offset = null)
461462
: false;
462463
}
463464

464-
function insert($table = '', $keyValue)
465+
function insert($table = '', $keyValue = null)
465466
{
466467
$ezQuery = \getInstance();
467468
return ($ezQuery instanceof DatabaseInterface)
468469
? $ezQuery->insert($table, $keyValue)
469470
: false;
470471
}
471472

472-
function update($table = '', $keyValue, ...$args)
473+
function update($table = '', $keyValue = null, ...$args)
473474
{
474475
$ezQuery = \getInstance();
475476
return ($ezQuery instanceof DatabaseInterface)
@@ -485,7 +486,7 @@ function deleting($table = '', ...$args)
485486
: false;
486487
}
487488

488-
function replace($table = '', $keyValue)
489+
function replace($table = '', $keyValue = null)
489490
{
490491
$ezQuery = \getInstance();
491492
return ($ezQuery instanceof DatabaseInterface)

0 commit comments

Comments
 (0)