getRequestValue('id'))->first(); /** * get API */ $api =(new KerioManager()) ->getApiByServer($hosting->server) ->soap; /** * load domain from repo */ $domain = $api->repository() ->domains ->getByName($hosting->domain); $this->data['domainId'] = $domain->getId(); $this->data['domain'] = $hosting->domain; } public function update() { } public function create() { /** * hosting id */ $hid = $this->request->get('id'); /** * load product configuration */ $productManager = new ProductManager(); $productManager->loadByHostingId($hid); /** * load kerio manager by hosting id */ $service = (new KerioManager()) ->getApiByHosting($hid) ->soap ->service() ->createDomainAlias() ->setProductManager($productManager) ->setFormData($this->formData) ; /** * run service */ $result = $service->run(); /** * * return success or error response */ if(!$result) { return (new HtmlDataJsonResponse())->setMessageAndTranslate($service->getError())->setStatusError(); } return (new HtmlDataJsonResponse())->setMessageAndTranslate('domainAliasHasBeenCreated')->setStatusSuccess(); } }