Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
26 | 44 | public function insertHashes(int $modelId, string $column, array $hashes): void |
|
27 | { |
||
28 | 44 | foreach (array_chunk($hashes, 100) as $chunks) { |
|
29 | $insert = array_map(function ($hash) use ($modelId, $column) { |
||
30 | 44 | return "('$modelId', '$column', '$hash')"; |
|
31 | 44 | }, $chunks); |
|
32 | |||
33 | 44 | Query::statement("INSERT INTO $this->table (model_id, name, hash) VALUES ".implode(',', $insert)); |
|
34 | } |
||
66 |