src/Admin/CoreAdmin.php
public function removeAllFieldsFromFormGroup($groupName, $mapper)
    {
        $formGroups = $this->getFormGroups();
        foreach ($formGroups as $name => $formGroup) {
            if ($name === $groupName) {
                foreach ($formGroups[$name]['fields'] as $key => $field) {
                    $mapper->remove($key);
                }
            }
        }
    }
public function removeAllFieldsFromFormGroup($groupName, $mapper)
    {
        $formGroups = $this->getFormGroups();
        foreach ($formGroups as $name => $formGroup) {
            if ($name === $groupName) {
                foreach ($formGroups[$name]['fields'] as $key => $field) {
                    $mapper->remove($key);
                }
            }
        }
    }
public function removeAllFieldsFromFormGroup ( $ groupName , $ mapper ) { $ formGroups = $ this -> getFormGroups ( ) ; foreach ( $ formGroups as $ name => $ formGroup ) { if ( $ name === $ groupName ) { foreach ( $ formGroups [ $ name ] [ 'fields' ] as $ key => $ field ) { $ mapper -> remove ( $ key ) ; } } } }
Removes all fields from form groups and remove them from mapper.

@param string     $groupName Name of the group to remove
@param FormMapper $mapper    Sonata Admin form mapper
Removes all fields from form groups and remove them from mapper .