top-think / top-think/think-orm

【优化建议】模型writeTransform 中优化

Open
#318 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
437
Forks
188
PR merge metrics
No merged PRs in 30d

Description

数据写入 类型转换
如果使用自定义类来处理模型数据时,建议如果写入数据不是对象的时候直接初始化对象,不然使用模型存入数据时getChangedData调用的变化值不一定是对象期待的值
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the model writeTransform entry point and the getChangedData logic mentioned in the issue. Trace how custom-class data is converted when the written value is not an object, then verify that changed values match the custom class's expected form.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.