@@ 156-164 (lines=9) @@ | ||
153 | * |
|
154 | * @return bool |
|
155 | */ |
|
156 | protected function __multi(string $sql, array $values){ |
|
157 | pg_prepare($this->db, '', $this->replaceParams($sql)); |
|
158 | ||
159 | foreach($values as $row){ |
|
160 | pg_execute($this->db, '', $row); |
|
161 | } |
|
162 | ||
163 | return true; |
|
164 | } |
|
165 | ||
166 | /** |
|
167 | * @param string $sql |
|
@@ 173-181 (lines=9) @@ | ||
170 | * |
|
171 | * @return bool |
|
172 | */ |
|
173 | protected function __multi_callback(string $sql, array $data, $callback){ |
|
174 | pg_prepare($this->db, '', $this->replaceParams($sql)); |
|
175 | ||
176 | foreach($data as $row){ |
|
177 | pg_execute($this->db, '', call_user_func_array($callback, [$row])); |
|
178 | } |
|
179 | ||
180 | return true; |
|
181 | } |
|
182 | ||
183 | protected function replaceParams(string $sql):string{ |
|
184 | $i = 0; |