| @@ 245-256 (lines=12) @@ | ||
| 242 | * |
|
| 243 | * @return bool |
|
| 244 | */ |
|
| 245 | protected function __multi(string $sql, array $values){ |
|
| 246 | $stmt = $this->db->prepare($sql, $this->pdo_stmt_options); |
|
| 247 | ||
| 248 | foreach($values as $row){ |
|
| 249 | $this->bindParams($stmt, $row); |
|
| 250 | $stmt->execute(); |
|
| 251 | } |
|
| 252 | ||
| 253 | $stmt = null; |
|
| 254 | ||
| 255 | return true; |
|
| 256 | } |
|
| 257 | ||
| 258 | /** |
|
| 259 | * @param string $sql |
|
| @@ 265-276 (lines=12) @@ | ||
| 262 | * |
|
| 263 | * @return bool |
|
| 264 | */ |
|
| 265 | protected function __multi_callback(string $sql, array $data, $callback){ |
|
| 266 | $stmt = $this->db->prepare($sql, $this->pdo_stmt_options); |
|
| 267 | ||
| 268 | foreach($data as $row){ |
|
| 269 | $this->bindParams($stmt, call_user_func_array($callback, [$row])); |
|
| 270 | $stmt->execute(); |
|
| 271 | } |
|
| 272 | ||
| 273 | $stmt = null; |
|
| 274 | ||
| 275 | return true; |
|
| 276 | } |
|
| 277 | ||
| 278 | } |
|
| 279 | ||