Actually loading data that are not casted to the appropriate data type (in particular numbers) cause the attribute to be marked as dirty even if the value is not changed, this cause:
Actually to avoid this you need to manually setup filters to cast the value to the appropriate data type.
Since Model knows attribute data type the value should be casted to the appropriate data type automatically.
This would save a lot of time avoiding setting up filters that are always needed for optimal coding and errors giving false positive during dirty checking.
Samdark is proposing to plan it as an enhancement for 2.1
http://www.yiiframework.com/forum/index.php?showtopic=70660&view=getnewpost
@yiisoft/core-developers what do you think about doing it by default?
Is this related too to PHP PDO returning everything as strings? I know that there, one could get the necessary behavior by disabling emulate prepares.
Yes and yes. Still, disabling emulated prepares isn't always desired.
Can be solved by #12067
Yes. That's the best way to solve it so far.
Resolved by #12067
Most helpful comment
@yiisoft/core-developers what do you think about doing it by default?