api->repository()->domains->getByName($this->formData['domain']); if(!$domain) { $this->setError($this->api->account->getLastResult()->getLastErrorCode()); return false; } $domain->setAttrs([ Domain::ATTR_DOMAIN_STATUS => Kerio::ACC_STATUS_SUSPEND, Domain::ATTR_MAIL_STATUS => Kerio::DISABLED, ]); $response = $this->api->domain->update($domain); if(!$response) { $this->setError($this->api->domain->getLastResult()->getLastErrorCode()); return false; } return true; } }