<?php

namespace ThurData\Servers\KerioEmail\App\UI\Client\EmailAccount\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\EmailAccount\Providers\EditAccountDataProvider;
use ThurData\Servers\KerioEmail\App\UI\Client\EmailAccount\Sections\EditAdditionalSection;
use ThurData\Servers\KerioEmail\App\UI\Client\EmailAccount\Sections\EditForwardSection;
use ThurData\Servers\KerioEmail\App\UI\Client\EmailAccount\Sections\EditGeneralSection;
use ThurData\Servers\KerioEmail\Core\UI\Interfaces\ClientArea;
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\FormConstants;

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

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

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

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

        $this->addSection(new EditAdditionalSection());

        $this->addSection(new EditForwardSection());
    }
}