• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/validator.php
  • Класс: BitrixBizprocValidator
  • Вызов: Validator::validateArray
public function validateArray(string $name, string $keyType = self::TYPE_NUMERIC,
	string $valueType = self::TYPE_STRING): self
{
	if (!isset($this->dirtyValues[$name]))
	{
		return $this;
	}

	foreach ($this->dirtyValues[$name] as $key => $value)
	{
		if (!$this->validate($keyType, $key))
		{
			throw new ValidationException(Loc::getMessage("BIZPROC_VALIDATOR_ARRAY_KEY",
				["#name#" => $name, '#val#' => $key]));
		}
		if (!$this->validate($valueType, $value))
		{
			throw new ValidationException(Loc::getMessage("BIZPROC_VALIDATOR_ARRAY_VAL",
				["#name#" => $name, '#val#' => $key]));
		}
	}

	if (!is_array($this->dirtyValues[$name]))
	{
		throw new ValidationException(Loc::getMessage("BIZPROC_VALIDATOR_IS_ARRAY", ["#name#" => $name]));
	}

	$this->setPureValue($name);
	return $this;
}