<?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\AccountDataProvider;
use ThurData\Servers\KerioEmail\App\UI\Client\EmailAccount\Sections\AdditionalSection;
use ThurData\Servers\KerioEmail\App\UI\Client\EmailAccount\Sections\GeneralSection;
use ThurData\Servers\KerioEmail\Core\UI\Interfaces\ClientArea;
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\FormConstants;

/**
 *
 * Created by PhpStorm.
 * User: ThurData
 * Date: 10.09.19
 * Time: 13:06
 * Class AddAccountForm
 */
class AddAccountForm extends SortedFieldForm implements ClientArea
{
    use FormExtendedTrait;

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

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

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


    }
}