• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/requisite/importhelper.php
  • Класс: Bitrix\Crm\Requisite\ImportHelper
  • Вызов: ImportHelper::parseRow
public function parseRow($row)
{
	$result = new Main\Result();

	if (($this->rowNumber + 1) > $this->rowLimit)
	{
		$result->addError(
			new Main\Error(
				Loc::getMessage('CRM_RQ_IMP_HLPR_ERR_NEXT_ROW_LIMIT', array('#ROW_LIMIT#' => $this->rowLimit)),
				self::ERR_ROW_LIMIT
			)
		);

		return $result;
	}

	$this->rows[] = $row;
	$this->rowNumber++;

	$entityKeyValue = $this->parseEntityKey($row);
	if (!$this->searchNextEntityMode && $this->rowNumber === 1 && $entityKeyValue == '')
	{
		$result->addError(
			new Main\Error(Loc::getMessage('CRM_RQ_IMP_HLPR_ERR_EMPTY_KEY_FIELDS'), self::ERR_EMPTY_KEY_FIELDS)
		);

		return $result;
	}

	if ($entityKeyValue <> '' && $this->entityKeyValue !== $entityKeyValue)
	{
		if ($this->rowNumber === 1)
		{
			$this->entityKeyValue = $entityKeyValue;
		}
		else
		{
			$result->addError(
				new Main\Error(Loc::getMessage('CRM_RQ_IMP_HLPR_ERR_NEXT_ENTITY'), self::ERR_NEXT_ENTITY)
			);
		}

		if ($this->searchNextEntityMode)
		{
			$this->rows = array($this->rows[count($this->rows) - 1]);
			$this->rowNumber = 1;
			$this->searchNextEntityMode = false;
		}
		else if ($this->rowNumber > 1)
		{
			unset($this->rows[--$this->rowNumber]);
		}

		return $result;
	}

	return $result;
}