Exemple #1
0
 /**
  * @param DataUnitComponentInterface $child
  */
 protected function storeValue(DataUnitComponentInterface $child)
 {
     // add the value of the component to the values of this container
     $this->values[$child->getName()] = $child->getValue();
     // also store the value the standard way
     parent::storeValue($child);
 }
Exemple #2
0
 /**
  * @param $args
  * @param $value
  * @param DataUnitComponentInterface $component
  */
 protected function prepareExceptionParams($args, $value, DataUnitComponentInterface $component)
 {
     $args['value'] = $value;
     $args['component'] = $component->getId();
     return $args;
 }
Exemple #3
0
 /**
  * @param DataUnitComponentInterface $input
  * @param $value
  * @return bool
  */
 protected function preprocessInputValue(DataUnitComponentInterface $input, $value)
 {
     // TODO: decide what interface to put this in
     if ($input instanceof AbstractControl) {
         if (is_string($value)) {
             // trim the raw value
             if ($input->shouldTrimValue()) {
                 $value = trim($value);
             }
             // if the value is an empty string, and that is considered empty, return null
             if ($input->emptyStringIsValue() === false && strlen($value) === 0) {
                 return null;
             }
             return $value;
         }
     }
     return null;
 }