yiisoft / active-record

Active Record database abstraction layer
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
68 stars 28 forks source link

BaseActiveRecordTrait allow attribute setter #298

Closed anovsiradj closed 4 months ago

anovsiradj commented 6 months ago
Q A
Is bugfix? ✔️
New feature?
Breaks BC? ✔️❌ (maybe)
Fixed issues comma-separated list of tickets # fixed by the PR, if any

attribute setter not working, when canSetProperty('passwordRepeat') said true but, when i do $model->passwordRepeat =$post['password_repeat'] it is throwing Setting unknown property: app\models\User::passwordRepeat.

the code was using the same technique as Yii2 https://github.com/yiisoft/yii2/blob/97ca1f2b18a301d2e932f8eb4b07410d96a17edb/framework/base/Component.php#L178

what-the-diff[bot] commented 6 months ago

PR Summary

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 88.51%. Comparing base (d2fa237) to head (a0af203). Report is 2 commits behind head on master.

Files Patch % Lines
src/BaseActiveRecordTrait.php 50.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #298 +/- ## ============================================ - Coverage 88.63% 88.51% -0.12% - Complexity 575 576 +1 ============================================ Files 7 7 Lines 1302 1306 +4 ============================================ + Hits 1154 1156 +2 - Misses 148 150 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Tigrov commented 4 months ago

Try it now, should work.