00001 <?php 00007 abstract class AbstractListField extends AbstractField 00008 { 00009 protected $options = array(); 00010 00017 public function __construct($name, Form &$parentForm, array $attribs = array()) 00018 { 00019 parent::__construct($name, $parentForm, $attribs); 00020 00021 if(!array_key_exists('options', $attribs)) 00022 throw new Exception('options key not set in attribs array'); 00023 00024 $this->options = $attribs['options']; 00025 } 00026 00032 public function __set($name, $value) 00033 { 00034 if($name == 'options') 00035 { 00036 if(!is_array($value)) 00037 throw new Exception('options must be an array'); 00038 00039 $this->options = $value; 00040 } 00041 else 00042 parent::__set($name, $value); 00043 } 00044 } 00045 00046 ?>