This block is a 100% copy of what you are inheriting. `lastInsertId()` should be removed completely.