original_string: protected function addReview()
      {
          $submitted = $this->getSubmitted();
          $added = $this->review->add($submitted);
  
          if (empty($added)) {
              $message = $this->text('Review has not been added');
              $this->redirect('', $message, 'warning');
          }
  
          $message = $this->text('Review has been added');
  
          if (empty($submitted['status'])) {
              $message = $this->text('Review has been added and will be published after approval');
          }
  
          $this->redirect("product/{$this->data_product['product_id']}", $message, 'success');
      }
code: protected function addReview()
      {
          $submitted = $this->getSubmitted();
          $added = $this->review->add($submitted);
  
          if (empty($added)) {
              $message = $this->text('Review has not been added');
              $this->redirect('', $message, 'warning');
          }
  
          $message = $this->text('Review has been added');
  
          if (empty($submitted['status'])) {
              $message = $this->text('Review has been added and will be published after approval');
          }
  
          $this->redirect("product/{$this->data_product['product_id']}", $message, 'success');
      }
code_tokens: protected function addReview ( ) { $ submitted = $ this -> getSubmitted ( ) ; $ added = $ this -> review -> add ( $ submitted ) ; if ( empty ( $ added ) ) { $ message = $ this -> text ( 'Review has not been added' ) ; $ this -> redirect ( '' , $ message , 'warning' ) ; } $ message = $ this -> text ( 'Review has been added' ) ; if ( empty ( $ submitted [ 'status' ] ) ) { $ message = $ this -> text ( 'Review has been added and will be published after approval' ) ; } $ this -> redirect ( "product/{$this->data_product['product_id']}" , $ message , 'success' ) ; }
docstring: Adds a submitted review
docstring_tokens: Adds a submitted review