sorry for the vague title... I have a problem with a php4 class that seems hard to put to words.
My class has a "possibleValues" array, that holds information on what kind of values are acceptable for certain attributes that can be changed from the outside. In my pseudocode example below you can see that I have attributes that share the same acceptable values (colors). Obviously, the $this->colors
in my code fails, because you can't define one class variable via another (can you?).
How would I go about setting a common colors array that I could reference like this so I don't have to repeat the same valid options for different fields that allow the same values?
Class MyTest {
var $colors = array('red', 'yellow', 'blue');
var $possibleValues = array(
'someAttribute', array(0,1),
'someEmotions', array('happy, 'sad'),
--> 'someColorableAttribute', $this->colors,
--> 'someOtherColorableAttribute', $this->colors,
);
...
}