I have a class where I'm using __set
. Because I don't want it to set just anything, I have an array of approved variables that it checks before it will actually set a class property.
However, on construct, I want the __construct
method to set several class properties, some of which are not in the approved list. So when construct happens, and I do $this->var = $value
, I of course get my exception that I'm not allowed to set that variable.
Can I get around this somehow?