public function __set($key, $value)
 {
     // we must have both this and set() per behavior of WireArray::__set()
     // which throws exceptions if attempting to set a property
     if (SelectableOption::isProperty($key)) {
         return $this->setProperty($key, $value);
     }
     return parent::__set($key, $value);
 }
 /**
  * Convert an array of option arrays, to a SelectableOptionArray of SelectableOption objects
  * 
  * @param array $value
  * @return SelectableOptionArray
  * @throws WireException
  * 
  */
 protected function optionsArrayToObjects(array $value)
 {
     $options = new SelectableOptionArray();
     foreach ($value as $o) {
         $option = new SelectableOption();
         foreach ($o as $k => $v) {
             $option->set($k, $v);
         }
         $options->add($option);
     }
     return $options;
 }
示例#3
0
 /**
  * PHP5 type constructor
  */
 function __construct($defaultValue, $label = '', $textBefore = '', $textAfter = '')
 {
     parent::__construct('', $defaultValue, $label, $textBefore, $textAfter);
 }