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); } } }
/** * @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); } }