/** * Set options * * Intercept checked and unchecked values and set them early; test stored * value against checked and unchecked values after configuration. * * @param array $options * @return \Zend\Form\Element\Checkbox */ public function setOptions(array $options) { if (array_key_exists('checkedValue', $options)) { $this->setCheckedValue($options['checkedValue']); unset($options['checkedValue']); } if (array_key_exists('uncheckedValue', $options)) { $this->setUncheckedValue($options['uncheckedValue']); unset($options['uncheckedValue']); } parent::setOptions($options); $curValue = $this->getValue(); $test = array($this->getCheckedValue(), $this->getUncheckedValue()); if (!in_array($curValue, $test)) { $this->setValue($curValue); } return $this; }
/** * Set options * * Overrides to allow passing captcha options * * @param array $options * @return \Zend\Form\Element\Captcha */ public function setOptions(array $options) { if (array_key_exists('captcha', $options)) { if (array_key_exists('captchaOptions', $options)) { $this->setCaptcha($options['captcha'], $options['captchaOptions']); unset($options['captchaOptions']); } else { $this->setCaptcha($options['captcha']); } unset($options['captcha']); } parent::setOptions($options); return $this; }
/** * Set object state from options array * * @param array $options * @return \Zend\Form\Element\File */ public function setOptions(array $options) { parent::setOptions($options); $adapter = $this->getTransferAdapter(); $adapter->setOptions($options); return $this; }