| @@ 182-190 (lines=9) @@ | ||
| 179 | * |
|
| 180 | * @return bool |
|
| 181 | */ |
|
| 182 | protected function __multi(string $sql, array $values){ |
|
| 183 | pg_prepare($this->db, '', $this->replaceParams($sql)); |
|
| 184 | ||
| 185 | foreach($values as $row){ |
|
| 186 | pg_execute($this->db, '', $row); |
|
| 187 | } |
|
| 188 | ||
| 189 | return true; |
|
| 190 | } |
|
| 191 | ||
| 192 | /** |
|
| 193 | * @param string $sql |
|
| @@ 199-207 (lines=9) @@ | ||
| 196 | * |
|
| 197 | * @return bool |
|
| 198 | */ |
|
| 199 | protected function __multi_callback(string $sql, array $data, $callback){ |
|
| 200 | pg_prepare($this->db, '', $this->replaceParams($sql)); |
|
| 201 | ||
| 202 | foreach($data as $row){ |
|
| 203 | pg_execute($this->db, '', call_user_func_array($callback, [$row])); |
|
| 204 | } |
|
| 205 | ||
| 206 | return true; |
|
| 207 | } |
|
| 208 | ||
| 209 | protected function replaceParams(string $sql):string{ |
|
| 210 | $i = 0; |
|