data['id'] = $this->actionElementId; } /** * */ public function update() { // TODO: Implement update() method. } /** * @return HtmlDataJsonResponse|void */ public function delete() { /** * 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() ->deleteDomainAlias() ->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('domainAliasHasBeenDeleted')->setStatusSuccess(); } public function massDelete() { /** * 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() ->deleteDomainAlias(); /** * */ foreach($this->request->get('massActions') as $id) { $service->setFormData(['id' => $id]); $result = $service->run(); } return (new HtmlDataJsonResponse()) ->setMessageAndTranslate('massDomainAliasHasBeenDeleted') ->setStatusSuccess(); } }