您可以在中找到函数
MergeCollectionListener.php
从第91行开始:
// Remove deleted items before adding to free keys that are to be
// replaced
if ($this->allowDelete) {
foreach ($itemsToDelete as $key) {
unset($dataToMergeInto[$key]);
}
}
$dataToMergeInto
设置为
$dataToMergeInto = $event->getForm()->getNormData();
它指的是一个函数,其中
FormInterface.php
:
/**
* Returns the normalized data of the field.
*
* @return mixed When the field is not submitted, the default data is returned.
* When the field is submitted, the normalized submitted data is
* returned if the field is valid, null otherwise.
*/
public function getNormData();