original_string: public function insert(array $values) : int
      {
          $fields = $this->fields;
          array_shift($fields);
  
          $sql = 'INSERT INTO `' . $this->table . '` (' . implode(', ', $fields) . ') VALUES (:' . implode(', :', $fields) . ')';
          $query = $this->pdo->prepare($sql);
          foreach ($values as $key => &$value) {
              $query->bindParam(':' . $fields[$key], $value);
          }
          $query->execute();
  
          return $this->pdo->lastInsertId();
      }
code: public function insert(array $values) : int
      {
          $fields = $this->fields;
          array_shift($fields);
  
          $sql = 'INSERT INTO `' . $this->table . '` (' . implode(', ', $fields) . ') VALUES (:' . implode(', :', $fields) . ')';
          $query = $this->pdo->prepare($sql);
          foreach ($values as $key => &$value) {
              $query->bindParam(':' . $fields[$key], $value);
          }
          $query->execute();
  
          return $this->pdo->lastInsertId();
      }
code_tokens: public function insert ( array $ values ) : int { $ fields = $ this -> fields ; array_shift ( $ fields ) ; $ sql = 'INSERT INTO `' . $ this -> table . '` (' . implode ( ', ' , $ fields ) . ') VALUES (:' . implode ( ', :' , $ fields ) . ')' ; $ query = $ this -> pdo -> prepare ( $ sql ) ; foreach ( $ values as $ key => & $ value ) { $ query -> bindParam ( ':' . $ fields [ $ key ] , $ value ) ; } $ query -> execute ( ) ; return $ this -> pdo -> lastInsertId ( ) ; }
docstring: Insert a new record in the database
  @param array $values Values to insert, except id, since it is expected to be AUTO_INCREMENT
  @return int Return the last inserted id
  @since 1.1.4
docstring_tokens: Insert a new record in the database