formData['domain']) { $this->setError('Domain name can not be found.'); return false; } return parent::isValid(); // TODO: Change the autogenerated stub } public function process() { $accounts = $this->api->repository()->accounts->getByDomainName($this->formData['domain']); foreach($accounts as $account) { /* @var $account Account*/ foreach($this->productManager->getZimbraConfiguration() as $key => $value) { $value = $value === ProductParams::SWITCHER_ENABLED ? Zimbra::ATTR_ENABLED : Zimbra::ATTR_DISABLED; $account->setAttr($key, $value); $result = $this->api->account->update($account); if(!$result) { //todo some logs } } } return true; } }