original_string: protected function _afterSave(EntityInterface $comment)
      {
          $successMessage = $this->config('successMessage');
          if (is_callable($successMessage)) {
              $successMessage = $successMessage($comment, $this->_controller);
          }
  
          $this->_controller->Flash->success($successMessage, ['key' => 'commentsForm']);
          if ($this->config('redirectOnSuccess')) {
              $redirectTo = $this->config('redirectOnSuccess') === true ? $this->_controller->referer() : $this->config('redirectOnSuccess');
              $this->_controller->redirect($redirectTo);
          }
      }
code: protected function _afterSave(EntityInterface $comment)
      {
          $successMessage = $this->config('successMessage');
          if (is_callable($successMessage)) {
              $successMessage = $successMessage($comment, $this->_controller);
          }
  
          $this->_controller->Flash->success($successMessage, ['key' => 'commentsForm']);
          if ($this->config('redirectOnSuccess')) {
              $redirectTo = $this->config('redirectOnSuccess') === true ? $this->_controller->referer() : $this->config('redirectOnSuccess');
              $this->_controller->redirect($redirectTo);
          }
      }
code_tokens: protected function _afterSave ( EntityInterface $ comment ) { $ successMessage = $ this -> config ( 'successMessage' ) ; if ( is_callable ( $ successMessage ) ) { $ successMessage = $ successMessage ( $ comment , $ this -> _controller ) ; } $ this -> _controller -> Flash -> success ( $ successMessage , [ 'key' => 'commentsForm' ] ) ; if ( $ this -> config ( 'redirectOnSuccess' ) ) { $ redirectTo = $ this -> config ( 'redirectOnSuccess' ) === true ? $ this -> _controller -> referer ( ) : $ this -> config ( 'redirectOnSuccess' ) ; $ this -> _controller -> redirect ( $ redirectTo ) ; } }
docstring: Logic triggered after comment was successfully saved.
  
  @param \Cake\Datasource\EntityInterface $comment Comment that was just saved
  @return void
docstring_tokens: Logic triggered after comment was successfully saved .