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 PADS Logic 原理图
    • ¥15 PADS Logic 图标
    • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
    • ¥20 气象站点数据求取中~
    • ¥15 如何获取APP内弹出的网址链接
    • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
    • ¥50 STM32单片机传感器读取错误
    • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
    • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)
    • ¥15 机器人轨迹规划相关问题