• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/lib/ivr/ivr.php
  • Класс: BitrixVoximplantIvrIvr
  • Вызов: Ivr::persist
public function persist()
{
	$row = $this->toArray();
	unset($row['ID']);
	unset($row['ITEMS']);

	if($this->id > 0)
	{
		IvrTable::update($this->id, $row);
	}
	else
	{
		$insertResult = IvrTable::add($row);
		if(!$insertResult->isSuccess())
			throw new SystemException('Error while saving IVR menu to database');

		$this->id = $insertResult->getId();
	}
	
	foreach ($this->itemsToDelete as $item)
		$item->delete();

	$this->itemsToDelete = array();
	foreach ($this->items as $item)
	{
		$item->setIvrId($this->id);
		$item->persist();
	}
}