Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | * @return void |
||
25 | */ |
||
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)); |
|
66 |