original_string: public function updateBean($data)
      {
          if ($this->currentBean ==null) {
              throw new NoBeanException();
          }
  
          $result = $this->saveBean($this->currentBean, $data);
  
          // Return result
          if (empty($result->msg)) {
              $result->msg = "Saved.";
              $result->class = "callout-info";
          } else {
              $result->class = "callout-danger";
          }
  
          if ($this->afterUpdateBean != null) {
              $callable = $this->afterUpdateBean;
              $callable($this->currentBean, $result);
          }
  
          return $result;
      }
code: public function updateBean($data)
      {
          if ($this->currentBean ==null) {
              throw new NoBeanException();
          }
  
          $result = $this->saveBean($this->currentBean, $data);
  
          // Return result
          if (empty($result->msg)) {
              $result->msg = "Saved.";
              $result->class = "callout-info";
          } else {
              $result->class = "callout-danger";
          }
  
          if ($this->afterUpdateBean != null) {
              $callable = $this->afterUpdateBean;
              $callable($this->currentBean, $result);
          }
  
          return $result;
      }
code_tokens: public function updateBean ( $ data ) { if ( $ this -> currentBean == null ) { throw new NoBeanException ( ) ; } $ result = $ this -> saveBean ( $ this -> currentBean , $ data ) ; // Return result if ( empty ( $ result -> msg ) ) { $ result -> msg = "Saved." ; $ result -> class = "callout-info" ; } else { $ result -> class = "callout-danger" ; } if ( $ this -> afterUpdateBean != null ) { $ callable = $ this -> afterUpdateBean ; $ callable ( $ this -> currentBean , $ result ) ; } return $ result ; }
docstring: Update a bean.
  @param $data
  @return Result
  @throws NoBeanException
docstring_tokens: Update a bean .