/** * remove ServicePack to a Customer. * */ protected function removecustomerAction() { if (!$this->_hasParam('id')) { throw new InvalidArgumentException("Null Identifier recived"); } $spId = $this->_getParam('id'); if (!$this->getRequest()->isPut()) { throw new UnexpectedException("Resquest must be PUT"); } $data = $this->_helper->requestData(); $orgId = $data['orgId']; if (!strlen((string) $spId)) { throw new InvalidArgumentException("Null Identifier for service pack recived"); } if (!isset($orgId) && !strlen($orgId)) { throw new InvalidArgumentException("Null Identifier for organization recived"); } $sp = $this->_spSrv->load($spId); if (empty($sp)) { throw new NotFoundException("ServicePack {$spId} not found", 404); } $org = $this->_orgSrv->load($orgId); if (empty($org)) { throw new NotFoundException("Organization {$orgId} not found", 404); } $this->_helper->allowed('read', $sp); $this->_helper->allowed('read', $org); $this->_helper->allowed('unassign', $sp); $this->view->data = $this->_spSrv->removeCustomer($sp, $org); }