Uknown entity error when saving an instance of a class

can you share few lines?

of what please ??

The updated code is here https://gist.github.com/soforiokyere/59d6e68ef22c7026893ac6da773fae24

on which line you created new entry ?

Line 51 of payrollImplementation

you tried debugger where it is going ?

Your code updates the values in the current record. I want to create a new record entirely