Hi Tomas,
i understand that it will be huge work to rewrite oxid until it uses real
getters and setters.
But i wanted to adress an other problem which occurs because __get is used, and
__set don't. If you set a "virtual" property (e.g. a field which not exists in
database like oxcountry) by doing something like this:
$oUser->oxuser__oxcountry = new oxField('value', T_RAW);
PHP creates the property on $oUser as a public property. __get method is not
called on propertys, which are already existing on an object, therefore the
__get method is only called the first time the property gets read. Then, it's
called never again because the method getUserCountry sets the Country value
directly on the oxuser__oxcountry property.
if you would use the __set magic method to set such virtual propertys like
oxcountry and ensure that the property is never set directly to the object,
according to ensure that the __get magic method is always called when
requesting values of virtual propertys, then the problem i encountered wouldn't
occur.
It's a little bit hard to explain with e-mail :)
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general