205 $connection = \Bitrix\Main\Application::getConnection();
206 $head =
"REPLACE INTO $tableName (".implode(
", ", $fields).
") VALUES ";
207 $maxBodySize = 1024*1024;
210 foreach ($rows as $row)
212 $values =
"('".implode(
"', '", $row).
"')";
213 $bodySize += mb_strlen(
$values);
215 if ($bodySize > $maxBodySize)
217 $connection->query($head.implode(
", ", $body));
224 $connection->query($head.implode(
", ", $body));