/** * @expectedException Application\Exceptions\ValidateException */ public function testOrgCustomerRemoveFail() { $org = new OrgCustomerModel($this->_data); if (!$org) { $org->save(); } $result = $this->_service->delete($org); }
/** * Deletes the given organization */ public function deleteAction() { // Try to load the chosen organization $id = $this->getRequest()->getParam('id'); $org = $this->_orgSrv->load($id); if (empty($org)) { throw new NotFoundException('Organization ' . $id . ' not found', 404); } // Check permissions $this->_helper->allowed('delete', $org); $this->_orgSrv->delete($org); $this->view->data = true; }