original_string: public function update(IndexListener $listener)
      {
          $id    = Input::get('id');
          $model = $this->repository->find($id);
          $form  = $this->presenter->getForm($model);
          if (!$form->isValid()) {
              return $listener->updateValidationFailed($id, $form->getMessageBag());
          }
          try {
              $this->repository->updateNotification($id, Input::all());
          } catch (Exception $ex) {
              return $listener->updateFailed();
          }
  
          return $listener->updateSuccess();
      }
code: public function update(IndexListener $listener)
      {
          $id    = Input::get('id');
          $model = $this->repository->find($id);
          $form  = $this->presenter->getForm($model);
          if (!$form->isValid()) {
              return $listener->updateValidationFailed($id, $form->getMessageBag());
          }
          try {
              $this->repository->updateNotification($id, Input::all());
          } catch (Exception $ex) {
              return $listener->updateFailed();
          }
  
          return $listener->updateSuccess();
      }
code_tokens: public function update ( IndexListener $ listener ) { $ id = Input :: get ( 'id' ) ; $ model = $ this -> repository -> find ( $ id ) ; $ form = $ this -> presenter -> getForm ( $ model ) ; if ( ! $ form -> isValid ( ) ) { return $ listener -> updateValidationFailed ( $ id , $ form -> getMessageBag ( ) ) ; } try { $ this -> repository -> updateNotification ( $ id , Input :: all ( ) ) ; } catch ( Exception $ ex ) { return $ listener -> updateFailed ( ) ; } return $ listener -> updateSuccess ( ) ; }
docstring: updates notification notification
  
  @param IndexListener $listener
  @return RedirectResponse
docstring_tokens: updates notification notification