+ } else {
+ $key_table = $command['table'];
+ $key_condition = array_keys($command['conditions'])[0];
+ $value = array_values($command['conditions'])[0];
+
+ // Split the SQL queries in chunks of 100 values
+ // We do the $i stuff here to make the code better readable
+ $i = isset($counter[$key_table][$key_condition]) ? $counter[$key_table][$key_condition] : 0;
+ if (isset($compacted[$key_table][$key_condition][$i]) && count($compacted[$key_table][$key_condition][$i]) > 100) {
+ ++$i;
+ }
+
+ $compacted[$key_table][$key_condition][$i][$value] = $value;
+ $counter[$key_table][$key_condition] = $i;