• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/internals/sqlbatch.php
  • Класс: Bitrix\Sender\Internals\SqlBatch
  • Вызов: SqlBatch::divide
static function divide(array $list, $limit = 300)
{
	$length = count($list);
	if ($length < $limit)
	{
		return array($list);
	}

	$result = array();
	$partsCount = ceil($length / $limit);
	for ($index = 0; $index < $partsCount; $index++)
	{
		$result[$index] = array_slice($list, $limit * $index, $limit);
	}

	return $result;
}