<?php

namespace ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Services\Delete;


use ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Interfaces\ApiService;
use ModulesGarden\Servers\ZimbraEmail\App\Libs\Zimbra\Components\Api\Soap\Models\Domain;

/**
 *
 * Created by PhpStorm.
 * User: Tomasz Bielecki ( tomasz.bi@modulesgarden.com )
 * Date: 02.10.19
 * Time: 14:39
 * Class DeleteDomainAlias
 */
class DeleteDomainAlias extends ApiService
{

    public function process()
    {

        $domain = new Domain();
        $domain->setId($this->formData['id']);

        $result = $this->api->domain->delete($domain);

        if(!$result)
        {
            $this->setError($this->api->domain->getError());
            return false;
        }

        return true;
    }

}