Skip to content

Commit 2ab45b7

Browse files
committed
delete method
1 parent 9b9eb43 commit 2ab45b7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

core/model/Model.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,4 +219,18 @@ public function create($data)
219219
$this->count = $this->stmt->rowCount();
220220
}
221221

222+
public function delete()
223+
{
224+
$sql = "DELETE FROM {$this->table} ".self::where();
225+
226+
$this->stmt = $this->conn->prepare($sql);
227+
228+
if ( ! empty($this->where)) {
229+
self::param();
230+
}
231+
232+
$this->stmt->execute();
233+
$this->count = $this->stmt->rowCount();
234+
}
235+
222236
}

0 commit comments

Comments
 (0)