YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/MeetingServices/actions/SaveAjax.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

/**
 * Save Application.
 *
 * @package Settings.Action
 *
 * @copyright YetiForce S.A.
 * @license YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
 * @author Radosław Skrzypczak <r.skrzypczak@yetiforce.com>
 * @author Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>
 */
/**
 * Settings_MeetingServices_SaveAjax_Action class.
 */
class Settings_MeetingServices_SaveAjax_Action extends Settings_Vtiger_Index_Action
{
    /** {@inheritdoc} */
    public function process(App\Request $request)
    {
        if ($request->isEmpty('record', true)) {
            $recordModel = Settings_MeetingServices_Record_Model::getCleanInstance();
        } else {
            $recordModel = Settings_MeetingServices_Record_Model::getInstanceById($request->getInteger('record'));
        }
        $recordModel->setDataFromRequest($request);
        $result = $recordModel->save();

        $response = new Vtiger_Response();
        $response->setResult($result);
        $response->emit();
    }
}