original_string: public function deleteAction()
      {
          $model = $this->loadModel();
          if ($model->isObjectNew()) {
              $this->_forward('noroute');
              return;
          }
  
          try {
              $model->delete();
              $this->_redirectUrl($this->getHelper()->getGridUrl());
              $this->_getSession()->addSuccess('Deleted Successfully');
          } 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->_redirectUrl($this->getHelper()->getEditUrl($model));
          }
      }
code: public function deleteAction()
      {
          $model = $this->loadModel();
          if ($model->isObjectNew()) {
              $this->_forward('noroute');
              return;
          }
  
          try {
              $model->delete();
              $this->_redirectUrl($this->getHelper()->getGridUrl());
              $this->_getSession()->addSuccess('Deleted Successfully');
          } 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->_redirectUrl($this->getHelper()->getEditUrl($model));
          }
      }
code_tokens: public function deleteAction ( ) { $ model = $ this -> loadModel ( ) ; if ( $ model -> isObjectNew ( ) ) { $ this -> _forward ( 'noroute' ) ; return ; } try { $ model -> delete ( ) ; $ this -> _redirectUrl ( $ this -> getHelper ( ) -> getGridUrl ( ) ) ; $ this -> _getSession ( ) -> addSuccess ( 'Deleted Successfully' ) ; } 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 -> _redirectUrl ( $ this -> getHelper ( ) -> getEditUrl ( $ model ) ) ; } }
docstring: Delete an existing record
docstring_tokens: Delete an existing record