@@ 57-64 (lines=8) @@ | ||
54 | * |
|
55 | * @return int The nbr of affected rows |
|
56 | */ |
|
57 | public function update(string $table, array $filter = [], array $data = []): int |
|
58 | { |
|
59 | $sqlUpdate = $this->createUpdateSql($table, $data); |
|
60 | $sqlFilter = $this->createSqlFilter($filter); |
|
61 | $sql = $sqlUpdate . ($sqlFilter ? ' ' . $sqlFilter : ''); |
|
62 | ||
63 | return $this->executeCommand($sql, $filter, $data); |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * @return int The nbr of affected rows |
|
@@ 69-76 (lines=8) @@ | ||
66 | /** |
|
67 | * @return int The nbr of affected rows |
|
68 | */ |
|
69 | public function delete(string $table, array $filter = []): int |
|
70 | { |
|
71 | $sqlDelete = "DELETE FROM `$table`"; |
|
72 | $sqlFilter = $this->createSqlFilter($filter); |
|
73 | $sql = $sqlDelete . ($sqlFilter ? ' ' . $sqlFilter : ''); |
|
74 | ||
75 | return $this->executeCommand($sql, $filter); |
|
76 | } |
|
77 | ||
78 | /** |
|
79 | * @throws BindingMicroOrmException |