• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/office365/dto/dto.php
  • Класс: BitrixCalendarSyncOffice365DtoDto
  • Вызов: Dto::initComplexProperties
private function initComplexProperties(array &$data)
{
	$map = $this->getComplexPropertyMap();
	foreach ($map as $key => $item)
	{
		if (!empty($item['isArray']) && !empty($data[$key]) && is_array($data[$key]))
		{
			$this->$key = [];
			foreach ($data[$key] as $property)
			{
				$this->$key[] = $this->prepareComplexProperty(
					$property,
					$item['class'],
					$item['isMandatory'] ?? false
				);
			}
		}
		elseif (empty($data[$key]))
		{
			$this->$key = null;
		}
		else
		{
			$this->$key = $this->prepareComplexProperty(
				$data[$key],
				$item['class'],
				$item['isMandatory'] ?? false
			);
		}
		unset($data[$key]);
	}
}