我有这个实体,我正在从你可以做常规的面板(编辑,添加等等)中保存我们的数据库。 不是一个大的,并且大多数时间都有大约1k行,并且可能数字总是在那个周围。 该实体有一些与其他实体相关的字段(如:位置,商店,品牌等)。
考虑到这一点,我需要创建的东西是某种变化的历史,比如它的版本。 用户将能够编辑当前的一个,或查看更改日志(报告)。
我正在考虑实现像onpreupdate或onprePersist这样的东西,甚至使用新的表格。 但是我觉得我会这样做,它已经存在了,我有点记得很久以前在教条指南上阅读有关修订的内容,但却无法找到它。
也许有人可以指出一些事情,甚至建议一个更好的方法。
I've this entity that i'm saving our database from a panel where u can do the usual (edit, add,etc..). Isn't a big one, and has around 1k rows most of the times, and probably the number will be always around that. This entity has a few fields that are a relation to other entities ones (like: location, store, brand, etc..).
With that in mind the thing i need to create is some kind of history of changes, like versions of it. The user will be able to edit the current one, or view a log of changes (a report).
I'm thinking to implement something in like onpreupdate or onprePersist, or even using a new Table for that. But i got the feeling i will be doing that it's already there, and i kinda remember reading something on doctrine guide long time ago about revisions and such but can't find it.
Maybe someone can point me out something or even suggest a better way of do it.
最满意答案
https://github.com/l3pp4rd/DoctrineExtensions
具有可记录的扩展名“Loggable - 帮助跟踪对象的更改和历史记录,还支持版本管理”。
https://github.com/Atlantic18/DoctrineExtensions
Has a loggable extension that "Loggable - helps tracking changes and history of objects, also supports version managment."
更多推荐
发布评论