• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/numerator/generator/numbergenerator.php
  • Класс: BitrixMainNumeratorGeneratorNumberGenerator
  • Вызов: NumberGenerator::setFromArrayOrDefault
protected function setFromArrayOrDefault($value, $config, $default = null, $type = null)
{
	if (property_exists(static::class, $value))
	{
		if ($config !== null && array_key_exists($value, $config))
		{
			if ($type === 'int')
			{
				$this->$value = intval($config[$value]);
			}
			elseif ($type === 'string')
			{
				$this->$value = (string)$config[$value];
			}
			elseif ($type === 'bool')
			{
				$this->$value = (bool)$config[$value];
			}
			else
			{
				$this->$value = $config[$value];
			}
		}
		else
		{
			$this->$value = $default;
		}
	}
}