In PHP you can do the following:
$foo = new Foo();
$foo->$newPropertyName = $value;
To dynamically add new property to the object. However when I try to do that:
$this->$newPropertyName = $value;
It doesn't work. How can I dynamically add new property from within the object?
UPDATE:
My class inherits from Yii CFormModel class. CFormModel overrides the PHP __set method so it causes the problem. How to do what I want? How to use default __set method?
newPropertyName. The property name is unknown to the developer. It is going to come from database.