M
M
mermash92019-09-10 11:37:28
symfony
mermash9, 2019-09-10 11:37:28

Is there a bundle for Symfony like DoctrineAuditBundle, but with the ability to generate a more extensive human-readable change text?

Needed to generate something like this text:
Order:
05/12/2019 - order creation - Product 1 added, Product 2 added, Product 3 added
05/13/2019 - order change - Product 2 - deleted, Product 4 changed to Product 5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Flying, 2019-09-10
@Flying

This is fairly easy to do via Doctrine lifecycle events . Hang handlers on preUpdate, pretPersist, prePremove, collect information from the events passed to you to form the log you need, then postFlushform a log entry from the collected information and write it down.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question