Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dcac64e

Browse files
implimented ddelete and update method
1 parent 9f8502b commit dcac64e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎src/Database/QueryBuilder.php‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,19 @@ public function create(array $data)
8181

8282
public function update(array $data)
8383
{
84-
84+
$this->fields = [];
85+
$this->operation = self::DML_TYPE_UPDATE;
86+
foreach ($data as $column => $value)
87+
{
88+
$this->fields[] = sprintf('%s%s%s', $column, self::OPERATORS[0], "'$value'");
89+
}
90+
return $this;
8591
}
8692

8793
public function delete()
8894
{
89-
95+
$this->operation = self::DML_TYPE_DELETE;
96+
return $this;
9097
}
9198

9299
public function raw($query)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /