// the child and the parent form. Instead, the parent form also takes
// changes in the grandchildren (i.e. children of the form that inherits
// its parent's data) into account.
// (see InheritDataAwareIterator below)
if (!
$this->inheritData
) { // If the form is compound, the view data is merged with the data
// of the children using the data mapper.
// If the form is not compound, the view data is assigned to the submitted data.
$viewData =
$this->config->
getCompound() ?
$this->viewData :
$submittedData;
if (FormUtil::
isEmpty($viewData)) { $emptyData =
$this->config->
getEmptyData();
if ($emptyData instanceof \Closure
) { $emptyData =
$emptyData($this,
$viewData);
} $viewData =
$emptyData;
} // Merge form data from children into existing view data
// It is not necessary to invoke this method if the form has no children,
// even if it is compound.