在 Magento 中找不到事件观察者类的函数定义

发布于 2024-09-06 17:05:51 字数 494 浏览 5 评论 0原文

对于任何见过/使用过 Magento 的人,您能告诉我在哪里可以找到 Catalog Product 的保存操作的 Event Observer 类的以下 3 个函数定义:-

  1. setBundleOptionsData()
  2. setBundleSelectionsData()
  3. 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:-

  1. setBundleOptionsData()
  2. setBundleSelectionsData()
  3. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白云不回头 2024-09-13 17:05:52

如果您对所有文件进行了搜索但找不到定义,那么这些文件很可能使用 PHP 的 神奇方法。该类是否(直接或间接)继承自 Varien_Object?如果是这样,那么这些都是简单的设置函数,将数据存储在对象内的数组中。

要取回这些值,您需要做的就是将“set”更改为“get”:

$this->setBundleOptionsData('whatever');
echo $this->getBundleOptionsData(); //Returns 'whatever'

如果您对其工作原理感兴趣,请查看 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':

$this->setBundleOptionsData('whatever');
echo $this->getBundleOptionsData(); //Returns 'whatever'

If you're interested in how this works, look inside class Varien_Object. I've also described the mechanism here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文