问题描述
我在 CategoryModel 中有一个名为 visibility 的自定义属性,可以从后台手动更改该属性,也可以从后台更改该属性来自cronjob的检查,该检查将检查类别中是否至少有一种产品。如果将其从后台更改,即使在其下找到任何产品,cronjob也不应更改可见性。当属性从后台更改时, 后台 中名为 最新更改 的部分会注册与属性相关的更改,但是我可以找不到如何或在哪里完成。
如何找出模型属性发生变化的位置? 来自Backoffice或Cronjob还是类似的东西?
SavedValues-跟踪属性值修改
如果您在Backoffice中修改属性的值,则该属性的原始值(修改前)和新值(修改后)存储在SavedValues中。早期的v6.7版本有用于处理SavedValues的HMC API,但是现在您必须编写灵活的查询才能从服务层获取条目。
查找更多信息
其他参考文献
how-to-access-savedvalues-and-savedvalue-entries
I have a custom attribute called visibility in CategoryModel and it can be changed both from backoffice manually and from a cronjob which checks whether there is at least one product under the category. If it is changed from backoffice, cronjob should not change the visibility even if any product is found under it. When an attribute is changed from backoffice, section called Last Changes in Backoffice registers changes related to attribute but I could not find how or where it is done.
How can I find out the place where an attribute of a model changes? From Backoffice or Cronjob or something like that?
SavedValues - Keeping Track of Attribute Value Modification
If you modify the value of an attribute in Backoffice then the original value of the attribute (before modification) and the new value (after modification) stores in SavedValues. Early v6.7 there was HMC API to deal with SavedValues, but now you have to write the flexible query to get the entries from the service layer.
Find more detail here
Edit: Answer to your question
Find the attribute entry into the SavedValueEntry, if the current attribute value matches the newValue
, then it was modified from the backoffice otherwise from the cronjob.
Other references
savedvalues-in-hybris
how-to-access-savedvalues-and-savedvalue-entries
这篇关于在Hybris中找出模型属性发生变化的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!