Skip to content

Commit 7daa74b

Browse files
author
rkr
committed
- Fixed a Bug were an insert could confound with placeholders or actual content
1 parent 0079add commit 7daa74b

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

src/Builder/Insert.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ public function addOrUpdate($field, $value) {
8888
* @return $this
8989
*/
9090
public function addExpr($str) {
91-
$this->fields[] = func_get_args();
91+
if(count(func_get_args()) > 1) {
92+
$this->fields[] = func_get_args();
93+
} else {
94+
$this->fields[] = $str;
95+
}
9296
return $this;
9397
}
9498

@@ -98,7 +102,11 @@ public function addExpr($str) {
98102
* @return $this
99103
*/
100104
public function updateExpr($str) {
101-
$this->update[] = func_get_args();
105+
if(count(func_get_args()) > 1) {
106+
$this->update[] = func_get_args();
107+
} else {
108+
$this->update[] = $str;
109+
}
102110
return $this;
103111
}
104112

@@ -107,8 +115,13 @@ public function updateExpr($str) {
107115
* @return $this
108116
*/
109117
public function addOrUpdateExpr($str) {
110-
$this->fields[] = func_get_args();
111-
$this->update[] = func_get_args();
118+
if(count(func_get_args()) > 1) {
119+
$this->fields[] = func_get_args();
120+
$this->update[] = func_get_args();
121+
} else {
122+
$this->fields[] = $str;
123+
$this->update[] = $str;
124+
}
112125
return $this;
113126
}
114127

0 commit comments

Comments
 (0)