public function editAction() { SxCms_Acl::requireAcl('sheets', 'sheets.edit'); $proxy = new SxModule_Sheets_Type_Proxy(); $type_id = (int) $this->_getParam('id'); $type = $proxy->getTypeById($type_id, $_SESSION['System']['lng']); if ($this->getRequest()->isPost()) { $mapper = new SxModule_Sheets_Type_Mapper(); $fields = $mapper->fromInput($this->_getAllParams(), $this->_editablefields()); $data = $mapper->toObject($fields, $type); $validator = new SxModule_Sheets_Type_Validator(); if ($validator->validate($data)) { $data->save(); $cache = Zend_Registry::get('cache'); $cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('SxModule_Sheets_Type')); $flashMessenger = $this->_helper->getHelper('FlashMessenger'); $flashMessenger->addMessage('Type werd succesvol aangepast!'); $this->_helper->redirector->gotoSimple('index', 'sheets_type'); } $type = $data; } $this->view->messages = Sanmax_MessageStack::getInstance('SxModule_Sheets_Type'); $this->view->type = $type; }