original_string: public function insertBean($data)
      {
          $bean = R::xdispense($this->tableName);
  
  
  
          $result =  $this->saveBean($bean, $data);
  
          if (empty($result->msg)) {
              $result->msg = "The record has been created successfully.";
              $result->class = "callout-info";
              $result->ok = true;
          } else {
              $result->ok = false;
              $result->class = "callout-danger";
  
          }
  
          if ($this->afterInsertBean != null) {
              $callable = $this->afterInsertBean;
              $callable($bean, $result);
          }
  
          return $result;
      }
code: public function insertBean($data)
      {
          $bean = R::xdispense($this->tableName);
  
  
  
          $result =  $this->saveBean($bean, $data);
  
          if (empty($result->msg)) {
              $result->msg = "The record has been created successfully.";
              $result->class = "callout-info";
              $result->ok = true;
          } else {
              $result->ok = false;
              $result->class = "callout-danger";
  
          }
  
          if ($this->afterInsertBean != null) {
              $callable = $this->afterInsertBean;
              $callable($bean, $result);
          }
  
          return $result;
      }
code_tokens: public function insertBean ( $ data ) { $ bean = R :: xdispense ( $ this -> tableName ) ; $ result = $ this -> saveBean ( $ bean , $ data ) ; if ( empty ( $ result -> msg ) ) { $ result -> msg = "The record has been created successfully." ; $ result -> class = "callout-info" ; $ result -> ok = true ; } else { $ result -> ok = false ; $ result -> class = "callout-danger" ; } if ( $ this -> afterInsertBean != null ) { $ callable = $ this -> afterInsertBean ; $ callable ( $ bean , $ result ) ; } return $ result ; }
docstring: Store Data into Database
  @param $data
  @return int|string
docstring_tokens: Store Data into Database