original_string: public function editAction()
      {
          $model = $this->loadModel();
          if ($model->isObjectNew()) {
              $this->_forward('noroute');
              return;
          }
  
          if ($this->getRequest()->isPost()) {
              $postData = $this->getRequest()->getPost();
              try {
                  foreach ($this->preprocessPostData($postData) as $key => $value) {
                      $model->setDataUsingMethod($key, $value);
                  }
                  $model->save();
                  $this->_redirectUrl($this->getHelper()->getGridUrl());
                  $this->_getSession()->addSuccess('Saved Successfully');
                  return;
              } catch (Exception $e) {
                  if ($e instanceof Zend_Db_Statement_Exception && $e->getChainedException() instanceof PDOException) {
                      $e = $e->getChainedException();
                  }
                  Mage::logException($e);
                  $this->_getSession()->addError($e->getMessage());
              }
          }
  
          $this->loadLayout();
          $this->renderLayout();
      }
code: public function editAction()
      {
          $model = $this->loadModel();
          if ($model->isObjectNew()) {
              $this->_forward('noroute');
              return;
          }
  
          if ($this->getRequest()->isPost()) {
              $postData = $this->getRequest()->getPost();
              try {
                  foreach ($this->preprocessPostData($postData) as $key => $value) {
                      $model->setDataUsingMethod($key, $value);
                  }
                  $model->save();
                  $this->_redirectUrl($this->getHelper()->getGridUrl());
                  $this->_getSession()->addSuccess('Saved Successfully');
                  return;
              } catch (Exception $e) {
                  if ($e instanceof Zend_Db_Statement_Exception && $e->getChainedException() instanceof PDOException) {
                      $e = $e->getChainedException();
                  }
                  Mage::logException($e);
                  $this->_getSession()->addError($e->getMessage());
              }
          }
  
          $this->loadLayout();
          $this->renderLayout();
      }
code_tokens: public function editAction ( ) { $ model = $ this -> loadModel ( ) ; if ( $ model -> isObjectNew ( ) ) { $ this -> _forward ( 'noroute' ) ; return ; } if ( $ this -> getRequest ( ) -> isPost ( ) ) { $ postData = $ this -> getRequest ( ) -> getPost ( ) ; try { foreach ( $ this -> preprocessPostData ( $ postData ) as $ key => $ value ) { $ model -> setDataUsingMethod ( $ key , $ value ) ; } $ model -> save ( ) ; $ this -> _redirectUrl ( $ this -> getHelper ( ) -> getGridUrl ( ) ) ; $ this -> _getSession ( ) -> addSuccess ( 'Saved Successfully' ) ; return ; } catch ( Exception $ e ) { if ( $ e instanceof Zend_Db_Statement_Exception && $ e -> getChainedException ( ) instanceof PDOException ) { $ e = $ e -> getChainedException ( ) ; } Mage :: logException ( $ e ) ; $ this -> _getSession ( ) -> addError ( $ e -> getMessage ( ) ) ; } } $ this -> loadLayout ( ) ; $ this -> renderLayout ( ) ; }
docstring: Edit an existing record
docstring_tokens: Edit an existing record