Commit d8a05af
fix: use setOption() method for think-orm 4.0 compatibility
- Use setOption() instead of direct property assignment
- Implement initialize() method for model configuration
- Prevent model data pollution as per think-orm 4.0 upgrade guide
- Fix table name fallback when rules_name is null
According to think-orm 4.0 official documentation:
"如果需要在模型内获取或设置模型属性的话改为使用模型的getOption或setOption方法"
This resolves:
- WeakMap initialization errors
- array_search type errors
- Table name configuration issues
Reference: https://doc.thinkphp.cn/@think-orm/v4_0/upgrade.html
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent c81e0d0 commit d8a05af
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
50 | 59 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
57 | | - | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
0 commit comments