Exemple #1
0
 /**
  * Sets the parameter definition values contained in the provided array.
  * @see ParamDefinition::setArrayValues
  *
  * @since 0.5
  *
  * @param array $param
  */
 public function setArrayValues(array $param)
 {
     parent::setArrayValues($param);
     if (array_key_exists('hastoexist', $param)) {
         $this->setHasToExist($param['hastoexist']);
     }
 }
Exemple #2
0
 /**
  * Sets the parameter definition values contained in the provided array.
  * @see ParamDefinition::setArrayValues
  *
  * @since 0.5
  *
  * @param array $param
  * @throws MWException
  */
 public function setArrayValues(array $param)
 {
     parent::setArrayValues($param);
     if (array_key_exists('range', $param)) {
         if (is_array($param['range']) && count($param['range']) == 2) {
             $this->setRange($param['range'][0], $param['range'][1]);
         } else {
             throw new MWException('The range argument must be an array with two elements');
         }
     }
     if (array_key_exists('lowerbound', $param)) {
         $this->setLowerBound($param['lowerbound']);
     }
     if (array_key_exists('upperbound', $param)) {
         $this->setUpperBound($param['upperbound']);
     }
 }
Exemple #3
0
 /**
  * Sets the parameter definition values contained in the provided array.
  * @see ParamDefinition::setArrayValues
  *
  * @since 0.5
  *
  * @param array $param
  */
 public function setArrayValues(array $param)
 {
     parent::setArrayValues($param);
     if (array_key_exists('tolower', $param)) {
         $this->toLower = $param['tolower'];
     }
     if (array_key_exists('length', $param)) {
         $this->setLength($param['length']);
     }
     if (array_key_exists('allowempty', $param)) {
         $this->canBeEmpty = $param['allowempty'];
     }
 }