• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/ivr/item.php
  • Класс: BitrixVoximplantIvrItem
  • Вызов: Item::toArray
public function toArray($resolveAdditionalFields = false)
{
	$result = array(
		'ID' => $this->id,
		'IVR_ID' => $this->ivrId,
		'NAME' => $this->name,
		'TYPE' => $this->type,
		'URL' => $this->url,
		'MESSAGE' => $this->message,
		'FILE_ID' => $this->fileId,
		'TIMEOUT' => $this->timeout,
		'TIMEOUT_ACTION' => $this->timeoutAction,
		'TTS_VOICE' => $this->ttsVoice,
		'TTS_SPEED' => $this->ttsSpeed,
		'TTS_VOLUME' =>$this->ttsVolume,
		'ACTIONS' => array()
	);

	if($resolveAdditionalFields)
	{
		if($this->type = static::TYPE_FILE && $this->fileId > 0)
		{
			$fileRecord = CFile::GetFileArray($this->fileId);
			if (mb_substr($fileRecord['SRC'], 0, 4) == 'http' || mb_substr($fileRecord['SRC'], 0, 2) == '//')
				$result['FILE_SRC'] = $fileRecord['SRC'];
			else
				$result['FILE_SRC'] = CVoxImplantHttp::GetServerAddress().$fileRecord['SRC'];
		}
	}
	
	foreach ($this->actions as $action)
	{
		$result['ACTIONS'][] = $action->toArray();
	}
	
	return $result;
}