droc60607 2019-07-03 09:42
浏览 77

良好做法:方法和实体

I'm using Doctrine for the first time (and without symfony) and I wonder if it's okay to add "classical" methods directly into the entity or if it's more correct to create another class next to it in order to manage all the other methods of this entity?

When I talk about other methods, I mean anything that is not getter and setter or Magic Methods. Like password encoding or any manipulation with the entity's properties.

Thank you in advance for your answers.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 用matlab写代码
    • ¥30 motoradmin系统的多对多配置
    • ¥15 求组态王串口自定义通信配置方法或代码?
    • ¥15 实验 :UML2.0 结构建模
    • ¥20 用vivado写数字逻辑实验报告撰写,FPGA实验
    • ¥15 为什么shp文件会有这种小方块?
    • ¥15 ecplise在连接数据库时显示加载驱动成功但是数据库连接失败
    • ¥15 visionmaster启动失败,提示为“机器不满足授权而被禁用”
    • ¥15 IDEA中圈复杂度如何具体设置
    • ¥50 labview采集不了数据