dqzpt40064 2014-02-18 11:07
浏览 6
已采纳

在Magento创建一个班级[最佳实践]

I have created a module in Magento. This module makes HTTP calls. I would like each HTTP response to be an object of a PHP Class, as I would like to run

$response->isError();
$response->getBody();
$response->getBodyJson();
// ... etc

Should I be creating a Model or Helper in this case ?

I am still figuring my way around Magento Architecture and Conventions.

  • 写回答

2条回答 默认 最新

  • duanrenzou1619 2014-02-18 11:28
    关注

    Basically model is the part of your application that defines its basic functionality behind a set of abstractions. Data access routines and some business logic can be defined in the model.

    Considering above statement, I think you should create Model for this.

    Hope this helps..

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效