// If the form inherits its parent's data, disallow data setting to
// prevent merge conflicts
if ($this->inheritData
) { throw new RuntimeException('You cannot change the data of a form inheriting its parent data.'
);
} // Don't allow modifications of the configured data if the data is locked
if ($this->config->
getDataLocked() &&
$modelData !==
$this->config->
getData()) { return $this;
} if (\
is_object($modelData) && !
$this->config->
getByReference()) { $modelData =
clone $modelData;
} if ($this->lockSetData
) { throw new RuntimeException('A cycle was detected. Listeners to the PRE_SET_DATA event must not call setData(). You should call setData() on the FormEvent object instead.'
);
} $this->lockSetData = true;
$dispatcher =
$this->config->
getEventDispatcher();
// Hook to change content of the model data before transformation and mapping children