学说实体......历史?(Doctrine Entity… history?)

编程入门 行业动态 更新时间:2024-10-28 03:22:46
学说实体......历史?(Doctrine Entity… history?)

我有这个实体,我正在从你可以做常规的面板(编辑,添加等等)中保存我们的数据库。 不是一个大的,并且大多数时间都有大约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."

更多推荐

本文发布于:2023-08-06 20:51:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1455383.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:学说   实体   历史   history   Entity

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!