Closed eduardor2k closed 1 year ago
CActiveRecord
Class
This update includes the addition of the #[\AllowDynamicProperties]
attribute to the CActiveRecord
class. This enhancement will boost the flexibility and dynamism of properties within this class. This means the system will now be more tolerant to properties that may be added dynamically, increasing overall system adaptability.How do you get this warning? AR should already disallow dynamic properties with __set()
implementation, and AllowDynamicProperties
should not change anything.
I will be looking into this, the official php docs don't say much about this, but the RFC has some clear examples:
https://wiki.php.net/rfc/deprecate_dynamic_properties
Closing down until I do some testing, thanks @rob006 for pointing that out!
This is implemented by framework, so I doubt you will find any PHP docs regarding this:
Set this class to Allow Dynamic Properties, this will allow all child classes to allow dynamic properties
https://www.php.net/manual/en/migration82.deprecated.php
This will prevent getting a warning trying to set a dynamic property in CActiveRecord objects
This can be fixed in userland code, but since this is the expected behaviour, I would expect not getting a warning when using dynamic properties.