Symfony/Doctrine - How do I create a checksum for a table row?

Viewed 25

the advent of data protection laws led to a myriad of security requirements... I need to implement an integrity functionality on every table row, preferably through doctrine.

Consider this:

A Table with 3 Columns A, B and C, where Column C is a checksum. When a user creates an entry by providing values for Column A and B, a checksum is generated by appending the values of A and B to a unique, permanent salt and saved to Column C.

Also, when a user changes the value of Column A, a new Checksum must be generated.

Is there a way to implement that functionality natively with doctrine, or is it only possible with custom Entity-Listeners?

Thank you

0 Answers
Related