<?php

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

use ThurData\Servers\KerioEmail\App\UI\Client\EmailAlias\Providers\DeleteEmailAliasDataProvider;
use ThurData\Servers\KerioEmail\Core\UI\Interfaces\ClientArea;
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\BaseForm;
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Hidden;
use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\FormConstants;

/**
 *
 * Created by PhpStorm.
 * User: ThurData
 * Date: 18.09.19
 * Time: 12:59
 * Class DeleteEmailAliasForm
 */
class DeleteEmailAliasForm extends BaseForm implements ClientArea
{
    protected $id    = 'deleteEmailAliasForm';
    protected $name  = 'deleteEmailAliasForm';
    protected $title = 'deleteEmailAliasForm';

    public function initContent()
    {
        $this->setFormType(FormConstants::DELETE);
        $this->dataProvider = new DeleteEmailAliasDataProvider();

        $this->setConfirmMessage('confirmDeleteEmailAlias');

        $field = new Hidden('id');
        $this->addField($field);

        $field = new Hidden('alias');
        $this->addField($field);

        $this->loadDataToForm();
    }
}