dpq755012465 2010-06-24 11:20
浏览 46
已采纳

在Magento中找不到Event Observer类的函数定义

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?

  • 写回答

1条回答 默认 最新

  • dtkwt62022 2010-06-24 12:25
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建