<?php

namespace ThurData\Servers\KerioEmail\App\UI\Client\Setting\Forms;

use ThurData\Servers\KerioEmail\App\Traits\FormExtendedTrait;
use ThurData\Servers\KerioEmail\App\UI\Admin\Custom\Forms\SortedFieldForm;
use ThurData\Servers\KerioEmail\App\UI\Client\Setting\Providers\EditSettingDataProvider;
use ThurData\Servers\KerioEmail\Core\UI\Interfaces\ClientArea;
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\FormConstants;
use ThurData\Servers\KerioEmail\App\UI\Client\Setting\Sections\EditGeneralSection;
use ThurData\Servers\KerioEmail\App\UI\Client\Setting\Sections\EditAdditionalSection;

/**
 *
 * Created by PhpStorm.
 * User: ThurData
 * Date: 18.09.19
 * Time: 09:29
 * Class EditSettingForm
 */
class EditSettingForm extends SortedFieldForm implements ClientArea
{
    use FormExtendedTrait;

    protected $id    = 'editSettingForm';
    protected $name  = 'editSettingForm';
    protected $title = 'editSettingForm';

    public function initContent()
    {
        $this->setFormType(FormConstants::UPDATE);
        $this->setProvider(new EditSettingDataProvider());
        $this->initFields();
        $this->loadDataToForm();
    }

    public function initFields()
    {
        $this->addSection(new EditGeneralSection());
        $this->addSection(new EditAdditionalSection());
    }
}