original_string: public function insert(array $data, $table = null)
      {
          $table = ($table) ?: $this->getTable();
          $sql = $this->getSql();
          $insert = $sql->insert($table);
  
          $insert->values($data);
  
          $statement = $sql->prepareStatementForSqlObject($insert);
          $result = $statement->execute();
  
          return $result->getGeneratedValue();
      }
code: public function insert(array $data, $table = null)
      {
          $table = ($table) ?: $this->getTable();
          $sql = $this->getSql();
          $insert = $sql->insert($table);
  
          $insert->values($data);
  
          $statement = $sql->prepareStatementForSqlObject($insert);
          $result = $statement->execute();
  
          return $result->getGeneratedValue();
      }
code_tokens: public function insert ( array $ data , $ table = null ) { $ table = ( $ table ) ? : $ this -> getTable ( ) ; $ sql = $ this -> getSql ( ) ; $ insert = $ sql -> insert ( $ table ) ; $ insert -> values ( $ data ) ; $ statement = $ sql -> prepareStatementForSqlObject ( $ insert ) ; $ result = $ statement -> execute ( ) ; return $ result -> getGeneratedValue ( ) ; }
docstring: Inserts a new row into database returns insertId
  
  @param array $data
  @param string $table
  @return int|null
docstring_tokens: Inserts a new row into database returns insertId