在 Magento 中找不到事件观察者类的函数定义
对于任何见过/使用过 Magento 的人,您能告诉我在哪里可以找到 Catalog Product 的保存操作的 Event Observer 类的以下 3 个函数定义:-
setBundleOptionsData()
setBundleSelectionsData()
setCanSaveBundleSelections()
请原谅我问了这么愚蠢的问题,但我真的很无助。 非常感谢任何帮助。
最糟糕的是,上述 3 个方法以一种很好的方式用于产品对象,&他们也在工作。但它们的定义在哪里呢?
编辑:-
好的,我可以理解这些是由“Varien_Object”使用的,并且这些是使用魔术方法概念的简单设置函数。但是,有人可以告诉一下,当程序计数器到达这样的函数时(在本例中是在事件观察者类中),编码流程是什么?
For anybody who has seen / used Magento, can you please tell me where can I find the following 3 function's definitions of the Catalog Product's save action's Event Observer class:-
setBundleOptionsData()
setBundleSelectionsData()
setCanSaveBundleSelections()
Please pardon me, for asking such a silly question, but I am really helpless.
Any help is greatly appreciated.
The worst part is that these above 3 methods are being used for the product object in a nice way, & they are working too. But where are their definitions?
EDIT:-
Okay, I can understand that these are used by the "Varien_Object", and these are simple setter functions using the concept of Magic Methods. But can somebody please tell what is the coding flow, when the program counter arrives at such a function, in this case in the Event Observer class?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您对所有文件进行了搜索但找不到定义,那么这些文件很可能使用 PHP 的 神奇方法。该类是否(直接或间接)继承自 Varien_Object?如果是这样,那么这些都是简单的设置函数,将数据存储在对象内的数组中。
要取回这些值,您需要做的就是将“set”更改为“get”:
如果您对其工作原理感兴趣,请查看 Varien_Object 类的内部。我还在此处描述了该机制。
If you have run a search on all the files and can't find the definition then these are most likely using PHP's magic methods. Is this class inheriting (directly or indirectly) from Varien_Object? If so, then these are simple setter functions storing data in an array within the object.
To get these values back all you need to do is change the 'set' to 'get':
If you're interested in how this works, look inside class Varien_Object. I've also described the mechanism here.