9 abstract class Less_Configurable
{
16 protected $options = array();
19 * Array of default options
23 protected $defaultOptions = array();
29 * If $options is an object it will be converted into an array by called
30 * it's toArray method.
33 * @param array|object $options
36 public function setOptions($options){
37 $options = array_intersect_key($options,$this->defaultOptions
);
38 $this->options
= array_merge($this->defaultOptions
, $this->options
, $options);
43 * Get an option value by name
45 * If the option is empty or not set a NULL value will be returned.
48 * @param mixed $default Default value if confiuration of $name is not present
51 public function getOption($name, $default = null){
52 if(isset($this->options
[$name])){
53 return $this->options
[$name];
65 public function setOption($name, $value){
66 $this->options
[$name] = $value;