/** Edit a decorative method. * @access public * @return void * @throws Pas_Exception_Param */ public function editdecorationmethodAction() { if ($this->getParam('id', false)) { $form = new DecMethodsForm(); $form->submit->setLabel(self::UPDATE); $this->view->form = $form; if ($this->getRequest()->isPost()) { if ($form->isValid($this->_request->getPost())) { $decs = new DecMethods(); $where = array(); $where[] = $decs->getAdapter()->quoteInto('id = ?', (int) $this->getParam('id')); $decs->update($form->getValues(), $where); $this->getFlash()->addMessage('Decoration method information updated!'); $this->redirect($this->_redirectUrl . 'decorationmethods'); } else { $form->populate($form->getValues()); } } else { $id = (int) $this->_request->getParam('id', 0); if ($id > 0) { $decs = new DecMethods(); $dec = $decs->fetchRow('id=' . $id); if (count($decs)) { $form->populate($dec->toArray()); } else { throw new Pas_Exception_Param($this->_nothingFound); } } } } else { throw new Pas_Exception_Param($this->_missingParameter, 500); } }