MultiFieldBase::extractValueSingle

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. MultiFieldBase
  4. extractValueSingle
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/bizproc/fieldtype/multifieldbase.php
  • Класс: Bitrix\Crm\Integration\BizProc\FieldType\MultiFieldBase
  • Вызов: MultiFieldBase::extractValueSingle
static function extractValueSingle(FieldType $fieldType, array $field, array $request)
{
	static::cleanErrors();
	$result = static::extractValue($fieldType, $field, $request);

	if (is_array($result))
	{
		$keys1 = array_keys($result);
		foreach ($keys1 as $key1)
		{
			if (is_array($result[$key1]))
			{
				$keys2 = array_keys($result[$key1]);
				foreach ($keys2 as $key2)
				{
					if (!isset($result[$key1][$key2]["VALUE"]) || empty($result[$key1][$key2]["VALUE"]))
						unset($result[$key1][$key2]);
				}
				if (count($result[$key1]) <= 0)
					unset($result[$key1]);
			}
			else
			{
				unset($result[$key1]);
			}
		}
		if (count($result) <= 0)
			$result = null;
	}
	else
	{
		$result = null;
	}

	$nameText = $field['Field'].'_text';
	$text = isset($request[$nameText]) ? $request[$nameText] : null;
	if (\CBPActivity::isExpression($text))
	{
		$result = $text;
	}

	return $result;
}

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