예제 #1
0
파일: Element.php 프로젝트: gsouf/uform
 /**
  * Internal use only. Should be called when a change occurs
  * on the parents and the info related to the parent need to be updated
  */
 public function refreshParent()
 {
     if ($this->parent) {
         $this->setNamespace($this->parent->getName(true, true));
         $this->setInternalNamespace($this->parent->getInternalName(true));
     }
 }
예제 #2
0
 public function prepareValidation(DataContext $localValues, FormContext $formContext)
 {
     parent::prepareValidation($localValues, $formContext);
     $value = $localValues->getDirectValue($this->getName());
     if (is_array($value)) {
         foreach ($value as $k => $v) {
             $element = $this->__getElemement($k);
             $element->prepareValidation(new DataContext($value), $formContext);
         }
     }
 }
예제 #3
0
파일: Group.php 프로젝트: gsouf/uform
 /**
  * @inheritdoc
  */
 public function prepareValidation(DataContext $localValues, FormContext $formContext)
 {
     parent::prepareValidation($localValues, $formContext);
     $name = $this->getName();
     foreach ($this->getElements() as $k => $v) {
         if ($name) {
             $values = $localValues->getDirectValue($name);
         } else {
             $values = $localValues->getDataCopy();
         }
         $v->prepareValidation(new DataContext($values), $formContext);
     }
 }