Skip to content

Commit 99a8a72

Browse files
committed
Fix for __call
1 parent cdf29b0 commit 99a8a72

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ To better secure queries, you can create your own var types classes, for example
2323

2424
SELECT example1 FROM exampleTable WHERE example = {value->secureString}
2525

26+
### Example with new method of calling SQL files
27+
28+
`<?php
29+
30+
use Beeflow\SQLQueryManager\SQLQuery
31+
32+
try {
33+
$query = new SQLQuery();
34+
$query->sqlExample([
35+
'value' => 'TEST_VALUE',
36+
'value2' => 11,
37+
'vatno' => '1111111111',
38+
'valueArrayWithoutAtype' => array('one', 'two', 'tree')
39+
]);
40+
41+
echo $query->getQuery();
42+
} catch (Exception $ex) {
43+
echo $ex->getMessage();
44+
}`
45+
46+
2647
### Example with a correct data:
2748

2849
`<?php

SQLQuery.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ public function openFile($sqlFileName)
146146
public function __call($name, $arguments)
147147
{
148148
$this->openFile($name);
149+
if (!isset($arguments[0])) {
150+
return;
151+
}
149152
foreach ($arguments[0] as $key => $argument) {
150153
$this->__set($key, $argument);
151154
}

0 commit comments

Comments
 (0)