Now can include WHERE clause on showAll() method
This commit is contained in:
@@ -144,18 +144,9 @@ abstract class Model
|
||||
try {
|
||||
$db = static::connectDB();
|
||||
|
||||
$result = $this->showAll('id', '=', $id);
|
||||
|
||||
foreach ($result as $post) {
|
||||
foreach ($post as $key => $val) {
|
||||
if (isset($args[$key])) {
|
||||
if ($args[$key] == $post[$key]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->showAll([
|
||||
['id', '=', $id]
|
||||
]);
|
||||
|
||||
$sql = "UPDATE {$table} SET {$fields} WHERE id = ?";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user