/** Edit a die axis * @access public * @return void * @throws Pas_Exception_Param */ public function editdieaxisAction() { if ($this->getParam('id', false)) { $form = new DieAxisForm(); $form->submit->setLabel('Update details'); $this->view->form = $form; if ($this->_request->isPost()) { if ($form->isValid($this->_request->getPost())) { $dieAxes = new Dieaxes(); $where = array(); $where[] = $dieAxes->getAdapter()->quoteInto('id = ?', $this->getParam('id')); $dieAxes->update($form->getValues(), $where); $this->redirect($this->_redirectUrl . 'dieaxes'); $this->getFlash()->addMessage('Die axis information updated!'); } else { $this->getFlash()->addMessage($this->_formErrors); $form->populate($this->_request->getPost()); } } else { // find id is expected in $params['id'] $id = (int) $this->_request->getParam('id', 0); if ($id > 0) { $dieaxes = new Dieaxes(); $dieaxis = $dieaxes->fetchRow('id=' . $id); if (count($dieaxis)) { $form->populate($dieaxis->toArray()); } else { throw new Pas_Exception_Param($this->_nothingFound); } } } } else { throw new Pas_Exception_Param($this->_missingParameter, 500); } }