/** * @see ValueValidator::setOptions * * @since 0.1 * * @param array $options */ public function setOptions(array $options) { parent::setOptions($options); if (array_key_exists('hastoexist', $options)) { $this->setHasToExist($options['hastoexist']); } }
/** * @see ValueValidator::setOptions * * @since 0.1 * * @param array $options * @throws Exception */ public function setOptions(array $options) { parent::setOptions($options); if (array_key_exists('allowauto', $options)) { $this->setAllowAuto($options['allowauto']); } if (array_key_exists('maxpercentage', $options)) { $this->setMaxPercentage($options['maxpercentage']); } if (array_key_exists('minpercentage', $options)) { $this->setMinPercentage($options['minpercentage']); } if (array_key_exists('units', $options)) { $this->setAllowedUnits($options['units']); } if (array_key_exists('defaultunit', $options)) { $this->setDefaultUnit($options['defaultunit']); } if (array_key_exists('lowerbound', $options)) { $this->setLowerBound($options['lowerbound']); } if (array_key_exists('upperbound', $options)) { $this->setUpperBound($options['upperbound']); } }
/** * @see ValueValidator::setOptions * * @since 0.1 * * @param array $options * @throws Exception */ public function setOptions(array $options) { parent::setOptions($options); if (array_key_exists('range', $options)) { if (is_array($options['range']) && count($options['range']) == 2) { $this->setRange($options['range'][0], $options['range'][1]); } else { throw new Exception('The range argument must be an array with two elements'); } } if (array_key_exists('withinrange', $options)) { if (is_array($options['withinrange']) && count($options['withinrange']) == 2) { $this->setWithinRange($options['withinrange'][0], $options['withinrange'][1]); } else { throw new Exception('The withinrange argument must be an array with two elements'); } } if (array_key_exists('lowerbound', $options)) { $this->setLowerBound($options['lowerbound']); } if (array_key_exists('upperbound', $options)) { $this->setUpperBound($options['upperbound']); } }