DOES::parseBatchDeprecated

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. DOES
  4. parseBatchDeprecated
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/dispatcher.php
  • Класс: BitrixTasksDOES
  • Вызов: DOES::parseBatchDeprecated
private function parseBatchDeprecated(array $batch)
{
	// parse code and sort first
	$i = 0;
	$codesUsed = array();
	foreach($batch as &$operation)
	{
		if(is_array($operation['PARAMETERS']))
		{
			$operation['PARAMETERS'] = array_change_key_case($operation['PARAMETERS'], CASE_UPPER);
		}
		else
		{
			$operation['PARAMETERS'] = array();
		}

		if((string) $operation['PARAMETERS']['CODE'] === '')
		{
			$operation['PARAMETERS']['CODE'] = 'op_'.$i;
		}

		if(isset($codesUsed[$operation['PARAMETERS']['CODE']]))
		{
			$this->errors->add('CODE_USED_MULTIPLE_TIMES', 'The following code is used more than once: '.$operation['PARAMETERS']['CODE'], static::ERROR_TYPE_PARSE);
		}
		else
		{
			$codesUsed[$operation['PARAMETERS']['CODE']] = true;
		}

		$i++;
	}
	unset($operation);

	$batchParsed = array();
	foreach($batch as $operation)
	{
		$op = new DispatcherOperation($operation, array('NAMESPACE' => $this->rootNamespace));
		$op->parse();
		$batchParsed[] = $op;
		$this->errors->load($op->getErrors());
	}

	return $batchParsed;
}

Добавить комментарий