• Модуль: mobile
  • Путь к файлу: ~/bitrix/modules/mobile/lib/Dto/Caster/Caster.php
  • Класс: BitrixMobileDtoCasterCaster
  • Вызов: Caster::cast
public function cast($value)
{
	if ($this->isCollection())
	{
		$result = [];
		if (is_array($value))
		{
			foreach ($value as $singleVal)
			{
				if ($this->isNullable && $singleVal === null)
				{
					$result[] = $singleVal;
				}
				else
				{
					$result[] = $this->castSingleValue($singleVal);
				}
			}
		}
		return $result;
	}

	if ($this->isNullable && $value === null)
	{
		return $value;
	}

	return $this->castSingleValue($value);
}